Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MSG_comm_test and MSG_comm_testany did not update isused
authorChristophe Thiéry <christopho128@gmail.com>
Wed, 16 Nov 2011 14:47:07 +0000 (15:47 +0100)
committerChristophe Thiéry <christopho128@gmail.com>
Wed, 16 Nov 2011 14:47:07 +0000 (15:47 +0100)
src/msg/msg_gos.c

index 608d9d5..c41dc38 100644 (file)
@@ -522,6 +522,11 @@ int MSG_comm_test(msg_comm_t comm)
   int finished = 0;
   TRY {
     finished = SIMIX_req_comm_test(comm->s_comm);
+
+    if (finished && comm->task_received != NULL) {
+      /* I am the receiver */
+      (*comm->task_received)->simdata->isused = 0;
+    }
   }
   CATCH(e) {
     switch (e.category) {
@@ -603,6 +608,11 @@ int MSG_comm_testany(xbt_dynar_t comms)
     comm = xbt_dynar_get_as(comms, finished_index, msg_comm_t);
     /* the communication is finished */
     comm->status = status;
+
+    if (status == MSG_OK && comm->task_received != NULL) {
+      /* I am the receiver */
+      (*comm->task_received)->simdata->isused = 0;
+    }
   }
 
   return finished_index;