Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some of the action checking code didn't work right, so I removed it.
[simgrid.git] / src / smpi / smpi_sender.c
index a03b421..26f5125 100644 (file)
@@ -105,15 +105,15 @@ 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);
 
                        SIMIX_mutex_unlock(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]);
-
                        // wake up receiver if necessary
                        receiver_process = smpi_global->receiver_processes[dindex];
                        if (SIMIX_process_is_suspended(receiver_process)) {