X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d43e84e981024537b56f15f7dcc937b0202cad2b..2e66bdc36efcaaf728af85511d74cf25cdd226c4:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index b933c632c4..945dfb47fd 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -76,14 +76,12 @@ void Actor::join(double timeout) void Actor::set_auto_restart(bool autorestart) { simgrid::simix::simcall([this, autorestart]() { + xbt_assert(autorestart && not pimpl_->auto_restart_); // FIXME: handle all cases pimpl_->set_auto_restart(autorestart); - std::map actors_map = pimpl_->host_->pimpl_->actors_at_boot_; - if (actors_map.find(pimpl_->name_) == actors_map.end()) { - 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()); - actors_map.insert({arg->name, arg}); - } + 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); }); }