From 10fa8a8eb7be70db4f1a68a53dd22f20681f7092 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 14 Mar 2019 22:03:15 +0100 Subject: [PATCH] let the actor clean for itself --- src/kernel/actor/ActorImpl.cpp | 6 ++++++ src/kernel/context/Context.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index 728f23d402..37c1d13153 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -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_); diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index dc182b945f..bbbf5eb061 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -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; -- 2.20.1