]> AND Public Git Repository - simgrid.git/blobdiff - examples/cpp/mc-centralized-mutex/s4u-mc-centralized-mutex.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revalidate the tesh of some working MC tests
[simgrid.git] / examples / cpp / mc-centralized-mutex / s4u-mc-centralized-mutex.cpp
index 288e6fb70faeafef1c8d03355a29a3806d6cf038..8614d2d262db5af612152f0f6cca33f5af7b9c81 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2021. The SimGrid Team.
+/* Copyright (c) 2010-2022. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,8 +12,8 @@
 
 #include "simgrid/s4u.hpp"
 
-#define AMOUNT_OF_CLIENTS 4
-#define CS_PER_PROCESS 2
+constexpr int AMOUNT_OF_CLIENTS = 4;
+constexpr int CS_PER_PROCESS    = 2;
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(centralized, "my log messages");
 
@@ -77,7 +77,7 @@ static void client()
     simgrid::s4u::this_actor::sleep_for(1);
 
     simgrid::s4u::Mailbox::by_name("coordinator")->put(new Message(Message::Kind::RELEASE, my_mailbox), 1000);
-    simgrid::s4u::this_actor::sleep_for(my_pid);
+    simgrid::s4u::this_actor::sleep_for(static_cast<double>(my_pid));
   }
   XBT_INFO("Got all the CS I wanted, quit now");
 }