]> AND Public Git Repository - simgrid.git/blobdiff - examples/c/async-wait/async-wait.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Const for pointer and reference parameters (slight return).
[simgrid.git] / examples / c / async-wait / async-wait.c
index 0e1fc40c52b51bdbe8788e83d73dff7b4a206d26..64ba4efd490ae6a59560fe46f4c1d31b0157d76c 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(async_wait, "Messages specific for this example");
 
-/* Main function of the Sender process */
+/* Main function of the Sender actor */
 static void sender(int argc, char* argv[])
 {
   xbt_assert(argc == 5, "The sender function expects 4 arguments from the XML deployment file");
@@ -45,19 +45,11 @@ static void sender(int argc, char* argv[])
     }
   }
 
-  sg_comm_t comm = sg_mailbox_put_async(mailbox, xbt_strdup("finalize"), 0);
   XBT_INFO("Send 'finalize' to 'receiver'");
-
-  if (sleep_test_time > 0) {
-    while (sg_comm_test(comm) == 0) {
-      sg_actor_sleep_for(sleep_test_time);
-    }
-  } else {
-    sg_comm_wait(comm);
-  }
+  sg_mailbox_put(mailbox, xbt_strdup("finalize"), 0);
 }
 
-/* Receiver process expects 3 arguments: */
+/* Receiver actor expects 3 arguments: */
 static void receiver(int argc, char* argv[])
 {
   xbt_assert(argc == 3, "The relay_runner function does not accept any parameter from the XML deployment file");