Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix https://github.com/simgrid/simgrid/issues/294
[simgrid.git] / src / s4u / s4u_Actor.cpp
index a5b89f6..18c9bba 100644 (file)
@@ -78,11 +78,11 @@ void Actor::set_auto_restart(bool autorestart)
   simgrid::simix::simcall([this, autorestart]() {
     pimpl_->set_auto_restart(autorestart);
 
-    std::map<std::string, kernel::actor::ProcessArg*> actors_map = pimpl_->host_->pimpl_->actors_at_boot_;
-    if (actors_map.find(pimpl_->name_) == actors_map.end()) {
+    std::map<std::string, kernel::actor::ProcessArg*>* 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});
+      actors_map->insert({arg->name, arg});
     }
   });
 }
@@ -97,15 +97,6 @@ void Actor::on_exit(std::function<void(int, void*)> fun, void* data)
   simgrid::simix::simcall([this, fun, data] { SIMIX_process_on_exit(pimpl_, fun, data); });
 }
 
-/** @brief Moves the actor to another host
- *
- * If the actor is currently blocked on an execution activity, the activity is also
- * migrated to the new host. If it's blocked on another kind of activity, an error is
- * raised as the mandated code is not written yet. Please report that bug if you need it.
- *
- * Asynchronous activities started by the actor are not migrated automatically, so you have
- * to take care of this yourself (only you knows which ones should be migrated).
- */
 void Actor::migrate(Host* new_host)
 {
   s4u::Actor::on_migration_start(this);