X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/54f9d48567e65bd17b9ad3544b5aad57bef54463..1b94b2100679d5b4355fccb6d22927efc12ca5bc:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 21398a2f2c..d4ecc67bea 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -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" @@ -40,11 +39,25 @@ ActorPtr Actor::self() return self_context->get_actor()->iface(); } +ActorPtr Actor::init(std::string name, s4u::Host* host) +{ + smx_actor_t self = SIMIX_process_self(); + simgrid::kernel::actor::ActorImpl* actor = + simgrid::simix::simcall([self, name, host] { return self->init(std::move(name), host).get(); }); + return actor->ciface(); +} + +ActorPtr Actor::start(std::function code) +{ + simgrid::simix::simcall([this, code] { pimpl_->start(code); }); + return this; +} ActorPtr Actor::create(std::string name, s4u::Host* host, std::function code) { simgrid::kernel::actor::ActorImpl* actor = simcall_process_create(std::move(name), std::move(code), nullptr, host, nullptr); + return actor->iface(); }