From: Martin Quinson Date: Thu, 14 Mar 2019 22:33:39 +0000 (+0100) Subject: Restarting or killing maestro does not seem to be a cleaver idea X-Git-Tag: v3_22~91 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/35e02c75e39b9d81ad7ab1a971e8627d396a8dac Restarting or killing maestro does not seem to be a cleaver idea --- diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index 55888daa5a..4569badaab 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -341,13 +341,15 @@ void ActorImpl::daemonize() s4u::Actor* ActorImpl::restart() { + xbt_assert(this != simix_global->maestro_process, "Restarting maestro is not supported"); + XBT_DEBUG("Restarting actor %s on %s", get_cname(), host_->get_cname()); // retrieve the arguments of the old actor ProcessArg arg = ProcessArg(host_, this); // kill the old actor - (this == simix_global->maestro_process) ? this->exit() : SIMIX_process_self()->kill(this); + context::Context::self()->get_actor()->kill(this); // start the new actor ActorImplPtr actor = diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 1b45a6a7e7..836de05be3 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -218,10 +218,8 @@ void Actor::kill() { kernel::actor::ActorImpl* process = SIMIX_process_self(); simix::simcall([this, process] { - if (pimpl_ == simix_global->maestro_process) - pimpl_->exit(); - else - process->kill(pimpl_); + xbt_assert(pimpl_ != simix_global->maestro_process, "Killing maestro is a rather bad idea"); + process->kill(pimpl_); }); }