Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Always call process_on_exit in the actor context
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 26 Jan 2019 08:49:26 +0000 (09:49 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 26 Jan 2019 08:50:52 +0000 (09:50 +0100)
src/kernel/context/Context.cpp
src/simix/ActorImpl.cpp

index e095919..13d14ad 100644 (file)
@@ -91,10 +91,13 @@ void Context::stop()
     watched_hosts.insert(actor_->host_->get_cname());
   }
 
+  actor_->finished_ = true;
+  SIMIX_process_on_exit_runall(actor_);
+
   if (this->cleanup_func_)
     this->cleanup_func_(this->actor_);
 
-  this->iwannadie = false; // don't let the yield call ourself -- Context::stop()
+  this->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), because that's me
   simgrid::simix::simcall([this] { SIMIX_process_cleanup(this->actor_); });
   this->iwannadie = true;
 }
index cb138fb..3f3936e 100644 (file)
@@ -56,9 +56,6 @@ void SIMIX_process_cleanup(smx_actor_t process)
   XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->get_cname(), process,
             process->waiting_synchro.get());
 
-  process->finished_ = true;
-  SIMIX_process_on_exit_runall(process);
-
   /* Unregister from the kill timer if any */
   if (process->kill_timer != nullptr) {
     SIMIX_timer_remove(process->kill_timer);