]> AND Public Git Repository - simgrid.git/blobdiff - src/s4u/s4u_Actor.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Hide Asan error.
[simgrid.git] / src / s4u / s4u_Actor.cpp
index 80eebd746552adbd3469d1fcf2c97b667f001028..0528b7116ca50542e984e80ac628d288dfd44b94 100644 (file)
@@ -157,13 +157,10 @@ void Actor::set_host(Host* new_host)
   const s4u::Host* previous_location = get_host();
 
   kernel::actor::simcall([this, new_host]() {
-    if (pimpl_->waiting_synchro_ != nullptr) {
-      // The actor is blocked on an activity. If it's an exec, migrate it too.
+    for (auto& activity : pimpl_->activities_) {
       // FIXME: implement the migration of other kinds of activities
-      kernel::activity::ExecImplPtr exec =
-          boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(pimpl_->waiting_synchro_);
-      xbt_assert(exec.get() != nullptr, "We can only migrate blocked actors when they are blocked on executions.");
-      exec->migrate(new_host);
+      if (auto exec = boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(activity))
+        exec->migrate(new_host);
     }
     this->pimpl_->set_host(new_host);
   });