Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the handling of SIMIX requests in model checker too.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sun, 8 May 2011 08:10:46 +0000 (10:10 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 9 May 2011 07:46:48 +0000 (09:46 +0200)
src/mc/mc_global.c

index 48b6872..9fcb58c 100644 (file)
@@ -76,15 +76,23 @@ int MC_random(int min, int max)
  */
 void MC_wait_for_requests(void)
 {
-  smx_req_t req = NULL;
+  smx_process_t process;
+  smx_req_t req;
+  unsigned int iter;
 
-  do {
+  while (xbt_dynar_length(simix_global->process_to_run)) {
     SIMIX_context_runall(simix_global->process_to_run);
-    while((req = SIMIX_request_pop())){
-      if(!MC_request_is_visible(req))
-        SIMIX_request_pre(req, 0);
+
+    xbt_dynar_t tmp = simix_global->process_that_ran;
+    simix_global->process_that_ran = simix_global->process_to_run;
+    simix_global->process_to_run = tmp;
+    xbt_dynar_reset(simix_global->process_to_run);
+    xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
+      req = &process->request;
+      if (req->call != REQ_NO_REQ && !MC_request_is_visible(req))
+          SIMIX_request_pre(req, 0);
     }
-  } while (xbt_dynar_length(simix_global->process_to_run));
+  }
 }
 
 int MC_deadlock_check()