X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b0d45659b3ca3d1a18fa754bb04ed74396b3bd7..2e43b2f67e50679deaceaa445c1ad48ecacd2f47:/src/smpi/smpi_sender.c diff --git a/src/smpi/smpi_sender.c b/src/smpi/smpi_sender.c index 0c84106236..26f5125a64 100644 --- a/src/smpi/smpi_sender.c +++ b/src/smpi/smpi_sender.c @@ -94,12 +94,6 @@ int smpi_sender(int argc, char **argv) action = SIMIX_action_communicate(shost, dhost, "communication", request->datatype->size * request->count, -1.0); - message->action = action; - - SIMIX_mutex_lock(smpi_global->received_message_queues_mutexes[dindex]); - xbt_fifo_push(smpi_global->received_message_queues[dindex], message); - SIMIX_mutex_unlock(smpi_global->received_message_queues_mutexes[dindex]); - SIMIX_register_action_to_condition(action, request->cond); for ( @@ -111,6 +105,10 @@ int smpi_sender(int argc, char **argv) SIMIX_cond_wait(request->cond, request->mutex); } + SIMIX_mutex_lock(smpi_global->received_message_queues_mutexes[dindex]); + xbt_fifo_push(smpi_global->received_message_queues[dindex], message); + SIMIX_mutex_unlock(smpi_global->received_message_queues_mutexes[dindex]); + SIMIX_unregister_action_to_condition(action, request->cond); SIMIX_action_destroy(action);