X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c0918d2c54c0f242790ec8db47e2c0892e1fa703..f9521627fe1cef73bb8eccd5b11735dcbd906dbd:/src/kernel/actor/ActorImpl.cpp diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index fc75399d82..992ab56b37 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -61,9 +61,11 @@ ActorImpl::ActorImpl(const simgrid::xbt::string& name, s4u::Host* host) : host_( ActorImpl::~ActorImpl() { - context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops - simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); }); - context_->iwannadie = true; + if (this != simix_global->maestro_process) { + context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops + simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); }); + context_->iwannadie = true; + } } /* Become an actor in the simulation @@ -183,6 +185,10 @@ void ActorImpl::cleanup() } simix_global->mutex.unlock(); + + context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops + simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_termination(*ciface()); }); + context_->iwannadie = true; } void ActorImpl::exit()