From: Martin Quinson Date: Mon, 21 Jan 2019 16:01:14 +0000 (+0100) Subject: Simplify the actor answer to iwannadie X-Git-Tag: v3_22~505 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2ea993e0850fee75ea52d854326103caa280ae6f Simplify the actor answer to iwannadie --- diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index 9415e8d09c..06e540232a 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -5,8 +5,10 @@ #include "mc/mc.h" +#include "simgrid/s4u/Host.hpp" #include "src/kernel/context/Context.hpp" #include "src/simix/smx_private.hpp" +#include "src/surf/surf_interface.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context); @@ -81,10 +83,18 @@ Context::~Context() void Context::stop() { + actor_->finished_ = true; + + if (actor_->auto_restart_ && actor_->host_->is_off()) { + XBT_DEBUG("Insert host %s to watched_hosts because it's off and %s needs to restart", actor_->host_->get_cname(), + actor_->get_cname()); + watched_hosts.insert(actor_->host_->get_cname()); + } + if (this->cleanup_func_) this->cleanup_func_(this->actor_); - this->iwannadie = false; + this->iwannadie = false; // don't let the yield call ourself -- Context::stop() 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 37547d7623..8071b9c1a4 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -741,22 +741,10 @@ void SIMIX_process_yield(smx_actor_t self) XBT_DEBUG("Control returned to me: '%s'", self->get_cname()); if (self->context_->iwannadie) { - XBT_DEBUG("I wanna die!"); - self->finished_ = true; - /* execute the on_exit functions */ - SIMIX_process_on_exit_runall(self); - - if (self->auto_restart_ && self->host_->is_off() && - watched_hosts.find(self->host_->get_cname()) == watched_hosts.end()) { - XBT_DEBUG("Push host %s to watched_hosts because it's off and %s needs to restart", self->host_->get_cname(), - self->get_cname()); - watched_hosts.insert(self->host_->get_cname()); - } XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host_->get_cname()); self->context_->stop(); - xbt_backtrace_display_current(); - xbt_die("I should be dead by now."); + THROW_IMPOSSIBLE; } if (self->suspended_) {