Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Split the behavior of ActorImpl::create
[simgrid.git] / src / s4u / s4u_Actor.cpp
index 21398a2..1d719e0 100644 (file)
@@ -10,7 +10,6 @@
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/VirtualMachine.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"
 
@@ -43,9 +42,12 @@ ActorPtr Actor::self()
 
 ActorPtr Actor::create(std::string name, s4u::Host* host, std::function<void()> code)
 {
+  smx_actor_t self = SIMIX_process_self();
+
   simgrid::kernel::actor::ActorImpl* actor =
-      simcall_process_create(std::move(name), std::move(code), nullptr, host, nullptr);
-  return actor->iface();
+      simgrid::simix::simcall([self, name, host, code] { return self->init(std::move(name), host)->start(code); });
+
+  return actor->ciface();
 }
 
 ActorPtr Actor::create(std::string name, s4u::Host* host, const std::string& function, std::vector<std::string> args)