X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6bc18b576fa4a890d8b9916d292ca67dfbf60dd3..361258ab0fbf44b907a966b0ad83c46fe7353925:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index c1d7128b9d..945dfb47fd 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -8,7 +8,9 @@ #include "simgrid/s4u/Exec.hpp" #include "simgrid/s4u/Host.hpp" #include "src/kernel/activity/ExecImpl.hpp" +#include "src/simix/smx_host_private.hpp" #include "src/simix/smx_private.hpp" +#include "src/surf/HostImpl.hpp" #include @@ -73,7 +75,14 @@ void Actor::join(double timeout) void Actor::set_auto_restart(bool autorestart) { - simgrid::simix::simcall([this, autorestart]() { pimpl_->set_auto_restart(autorestart); }); + simgrid::simix::simcall([this, autorestart]() { + xbt_assert(autorestart && not pimpl_->auto_restart_); // FIXME: handle all cases + pimpl_->set_auto_restart(autorestart); + + simgrid::kernel::actor::ProcessArg* arg = new simgrid::kernel::actor::ProcessArg(pimpl_->host_, pimpl_); + XBT_DEBUG("Adding Process %s to the actors_at_boot_ list of Host %s", arg->name.c_str(), arg->host->get_cname()); + pimpl_->host_->pimpl_->actors_at_boot_.emplace_back(arg); + }); } void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */