From 5fa36c1ba632f4bc75256c165dc9f1643e20d3e9 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 26 Jan 2019 09:49:26 +0100 Subject: [PATCH] Always call process_on_exit in the actor context --- src/kernel/context/Context.cpp | 5 ++++- src/simix/ActorImpl.cpp | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index e095919bf0..13d14adc88 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -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; } diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index cb138fbc6a..3f3936e87b 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -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); -- 2.20.1