Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
let the actor clean for itself
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 14 Mar 2019 21:03:15 +0000 (22:03 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 14 Mar 2019 21:03:15 +0000 (22:03 +0100)
src/kernel/actor/ActorImpl.cpp
src/kernel/context/Context.cpp

index 728f23d..37c1d13 100644 (file)
@@ -138,6 +138,12 @@ void ActorImpl::cleanup()
 
   XBT_DEBUG("Cleanup actor %s (%p), waiting synchro %p", get_cname(), this, waiting_synchro.get());
 
+  /* Unregister from the kill timer if any */
+  if (kill_timer != nullptr) {
+    kill_timer->remove();
+    kill_timer = nullptr;
+  }
+
   simix_global->mutex.lock();
 
   simix_global->process_list.erase(pid_);
index dc182b9..bbbf5eb 100644 (file)
@@ -99,12 +99,6 @@ void Context::stop()
   simgrid::simix::simcall([this] {
     simgrid::s4u::Actor::on_destruction(actor_->iface());
 
-    /* Unregister from the kill timer if any */
-    if (actor_->kill_timer != nullptr) {
-      actor_->kill_timer->remove();
-      actor_->kill_timer = nullptr;
-    }
-
     actor_->cleanup();
   });
   this->iwannadie = true;