X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7a5846ae0f17bbb8f9a0c907f36f15afa92cf73f..2a6d1b59788a13c520e32f3def71d0fc280d532d:/src/msg/msg_gos.c diff --git a/src/msg/msg_gos.c b/src/msg/msg_gos.c index 9b6086607f..ad96462b0c 100644 --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@ -8,6 +8,7 @@ #include "mc/mc.h" #include "xbt/log.h" #include "xbt/sysdep.h" +#include "simix/private.h" // FIXME XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)"); @@ -620,12 +621,6 @@ int MSG_comm_testany(xbt_dynar_t comms) */ void MSG_comm_destroy(msg_comm_t comm) { - if (comm->task_received != NULL - && *comm->task_received != NULL - && MSG_comm_get_status(comm) == MSG_OK) { - (*comm->task_received)->simdata->isused = 0; - } - xbt_free(comm); } @@ -739,6 +734,11 @@ int MSG_comm_waitany(xbt_dynar_t comms) /* the communication is finished */ comm->status = status; + if (comm->task_received != NULL) { + /* I am the receiver */ + (*comm->task_received)->simdata->isused = 0; + } + return finished_index; }