X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/059d37336a989dec544fd654d4375e741258e383..62dceedf62ca9df19fd3afee1458e21d9f211c5a:/examples/c/async-waitany/async-waitany.c diff --git a/examples/c/async-waitany/async-waitany.c b/examples/c/async-waitany/async-waitany.c index cfe912776d..3871f00ec1 100644 --- a/examples/c/async-waitany/async-waitany.c +++ b/examples/c/async-waitany/async-waitany.c @@ -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[])