X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4b41294c49f838248cf4b8e6883ddd94dfdf72d9..5bc3597e1513c7b94497ae0ea819e5fa2e28058a:/src/s4u/s4u_actor.cpp diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 6b6f2ef5d8..f3f5ab06bf 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -134,7 +134,7 @@ void Actor::kill(aid_t pid) { smx_actor_t process = SIMIX_process_from_PID(pid); if(process != nullptr) { - simcall_process_kill(process); + simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); }); } else { std::ostringstream oss; oss << "kill: ("<< pid <<") - No such process" << std::endl; @@ -147,7 +147,9 @@ smx_actor_t Actor::getImpl() { } void Actor::kill() { - simcall_process_kill(pimpl_); + smx_actor_t process = SIMIX_process_self(); + simgrid::simix::kernelImmediate( + [this, process] { SIMIX_process_kill(pimpl_, (pimpl_ == simix_global->maestro_process) ? pimpl_ : process); }); } // ***** Static functions ***** @@ -174,14 +176,12 @@ 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() @@ -296,7 +296,8 @@ bool isSuspended() void kill() { - simcall_process_kill(SIMIX_process_self()); + smx_actor_t process = SIMIX_process_self(); + simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); }); } void onExit(int_f_pvoid_pvoid_t fun, void* data)