Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
when set_auto_restart is set, it should be add to the list too
[simgrid.git] / src / s4u / s4u_Actor.cpp
index b1f7456..2aef0dc 100644 (file)
@@ -8,6 +8,7 @@
 #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 <sstream>
@@ -73,7 +74,10 @@ 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]() {
+    pimpl_->set_auto_restart(autorestart);
+    SIMIX_host_add_auto_restart_process(pimpl_->host_, pimpl_);
+  });
 }
 
 void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */