Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: manually increase the time when running the model-checkers on sleep calls.
[simgrid.git] / src / simix / smx_process.c
index 136a1f6..e182d8d 100644 (file)
@@ -15,6 +15,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix,
                                 "Logging specific to SIMIX (process)");
 
 unsigned long simix_process_maxpid = 0;
+/* FIXME: Ugly hack!*/
+extern double NOW;
 
 /**
  * \brief Returns the current agent.
@@ -246,6 +248,7 @@ void SIMIX_process_killall(void)
     SIMIX_process_kill(p, SIMIX_process_self());
 
   SIMIX_context_runall(simix_global->process_to_run);
+
   SIMIX_process_empty_trash();
 }
 
@@ -418,6 +421,7 @@ xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
 void SIMIX_pre_process_sleep(smx_req_t req)
 {
   if (MC_IS_ENABLED) {
+    NOW += req->process_sleep.duration;
     req->process_sleep.result = SIMIX_DONE;
     SIMIX_request_answer(req);
   }
@@ -510,8 +514,10 @@ void SIMIX_process_yield(void)
   /* Ok, maestro returned control to us */
   DEBUG1("Maestro returned control to me: '%s'", self->name);
 
-  if (self->context->iwannadie)
+  if (self->context->iwannadie){
+    DEBUG0("I wanna die!");
     SIMIX_context_stop(self->context);
+  }
 
   if (self->doexception) {
     DEBUG0("Wait, maestro left me an exception");