X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7ef49c428ab0209965a09a36ab28b59789aaa4b5..669001c1adb41a9dfc610fc2984709010f1a09e9:/src/s4u/s4u_actor.cpp diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index b8c5c27a66..7dcef8fee5 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -62,7 +62,7 @@ void Actor::join() { } void Actor::setAutoRestart(bool autorestart) { - simcall_process_auto_restart_set(pimpl_,autorestart); + simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; }); } void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data) @@ -174,14 +174,17 @@ void Actor::killAll(int resetPid) /** Retrieve the property value (or nullptr if not set) */ const char* Actor::getProperty(const char* key) { - return (char*)xbt_dict_get_or_null(simcall_process_get_properties(pimpl_), key); + return simgrid::simix::kernelImmediate([this, key] { return pimpl_->getProperty(key); }); } void Actor::setProperty(const char* key, const char* value) { - simgrid::simix::kernelImmediate([this, key, value] { - xbt_dict_set(simcall_process_get_properties(pimpl_), key, (char*)value, (void_f_pvoid_t) nullptr); - }); + simgrid::simix::kernelImmediate([this, key, value] { pimpl_->setProperty(key, value); }); +} + +Actor* Actor::restart() +{ + return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); }); } // ***** this_actor ***** @@ -216,36 +219,38 @@ XBT_PUBLIC(void) sleep_until(double timeout) simcall_process_sleep(timeout - now); } -e_smx_state_t execute(double flops) { +void execute(double flops) +{ smx_activity_t s = simcall_execution_start(nullptr,flops,1.0/*priority*/,0./*bound*/); - return simcall_execution_wait(s); + simcall_execution_wait(s); } -void* recv(MailboxPtr chan) { +void* recv(MailboxPtr chan) // deprecated +{ return chan->get(); } -void* recv(MailboxPtr chan, double timeout) +void* recv(MailboxPtr chan, double timeout) // deprecated { return chan->get(timeout); } -void send(MailboxPtr chan, void* payload, double simulatedSize) +void send(MailboxPtr chan, void* payload, double simulatedSize) // deprecated { chan->put(payload, simulatedSize); } -void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout) +void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout) // deprecated { chan->put(payload, simulatedSize, timeout); } -CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize) +CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize) // deprecated { return chan->put_async(payload, simulatedSize); } -CommPtr irecv(MailboxPtr chan, void** data) +CommPtr irecv(MailboxPtr chan, void** data) // deprecated { return chan->get_async(data); }