Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clearly state that we don't care about the return code of actors
[simgrid.git] / examples / c / async-waitany / async-waitany.c
index cfe9127..3871f00 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(async_waitany, "Messages specific for this example");
 
-static int sender(int argc, char* argv[])
+static void sender(int argc, char* argv[])
 {
   xbt_assert(argc == 4, "Expecting 3 parameters from the XML deployment file but got %d", argc);
   long messages_count  = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
@@ -63,7 +63,7 @@ static int sender(int argc, char* argv[])
    * Even in this simple example, the pending comms do not terminate in the exact same order of creation.
    */
   while (pending_comms_count != 0) {
-    int changed_pos = sg_comm_wait_any_for(pending_comms, pending_comms_count, -1);
+    int changed_pos = sg_comm_wait_any(pending_comms, pending_comms_count);
     memmove(pending_comms + changed_pos, pending_comms + changed_pos + 1,
             sizeof(sg_comm_t) * (pending_comms_count - changed_pos - 1));
     pending_comms_count--;
@@ -77,10 +77,9 @@ static int sender(int argc, char* argv[])
   free(mboxes);
 
   XBT_INFO("Goodbye now!");
-  return 0;
 }
 
-static int receiver(int argc, char* argv[])
+static void receiver(int argc, char* argv[])
 {
   xbt_assert(argc == 2, "Expecting one parameter from the XML deployment file but got %d", argc);
   int id = xbt_str_parse_int(argv[1], "ID should be numerical, not %s");
@@ -99,7 +98,6 @@ static int receiver(int argc, char* argv[])
   }
 
   XBT_INFO("I'm done. See you!");
-  return 0;
 }
 
 int main(int argc, char* argv[])