From 7a955948edf1a0c37594d87693315dfc2dac9a8f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 28 Jan 2019 09:16:17 +0100 Subject: [PATCH 1/1] Only unregister the kill timer once, in maestro context --- src/kernel/context/Context.cpp | 7 +++++++ src/simix/ActorImpl.cpp | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index c28bf7b2f1..2b846cfe66 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -116,6 +116,13 @@ void Context::stop() this->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), because that's me simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(actor_->iface()); + + /* Unregister from the kill timer if any */ + if (actor_->kill_timer != nullptr) { + SIMIX_timer_remove(actor_->kill_timer); + actor_->kill_timer = nullptr; + } + SIMIX_process_cleanup(actor_); }); this->iwannadie = true; diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 9b0f19bdbb..2e2065bd8c 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -56,12 +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()); - /* Unregister from the kill timer if any */ - if (process->kill_timer != nullptr) { - SIMIX_timer_remove(process->kill_timer); - process->kill_timer = nullptr; - } - simix_global->mutex.lock(); simix_global->process_list.erase(process->pid_); -- 2.20.1