Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check if process was suspended while it was sleeping.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 11 Mar 2014 08:40:54 +0000 (09:40 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 11 Mar 2014 09:29:49 +0000 (10:29 +0100)
Closes bug #17098.

src/simix/smx_process.c

index 1ef7148..8378a66 100644 (file)
@@ -742,7 +742,13 @@ void SIMIX_post_process_sleep(smx_action_t action)
     }
     simcall_process_sleep__set__result(simcall, state);
     simcall->issuer->waiting_action = NULL;
     }
     simcall_process_sleep__set__result(simcall, state);
     simcall->issuer->waiting_action = NULL;
-    SIMIX_simcall_answer(simcall);
+    if (simcall->issuer->suspended) {
+      XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
+      simcall->issuer->suspended = 0;
+      SIMIX_pre_process_suspend(simcall, simcall->issuer);
+    } else {
+      SIMIX_simcall_answer(simcall);
+    }
   }
 
   SIMIX_process_sleep_destroy(action);
   }
 
   SIMIX_process_sleep_destroy(action);