Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Extract assignment from expression.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 28 Feb 2022 16:11:39 +0000 (17:11 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 28 Feb 2022 16:11:39 +0000 (17:11 +0100)
teshsuite/s4u/monkey-masterworkers/monkey-masterworkers.cpp

index 9a89318..d38b58d 100644 (file)
@@ -124,8 +124,10 @@ int main(int argc, char* argv[])
 
   sg4::Actor::create("master", main, master)->set_auto_restart(true);
   int id = 0;
-  for (auto* h : worker_hosts)
-    sg4::Actor::create("worker", h, worker, id++)->set_auto_restart(true);
+  for (auto* h : worker_hosts) {
+    sg4::Actor::create("worker", h, worker, id)->set_auto_restart(true);
+    id++;
+  }
 
   todo = cfg_task_count;
   xbt_assert(todo > 0, "Please give more than %d tasks to run", todo);