X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4b6341214b2d35ec98121aa84d440733167d3912..7bfa729b876a8c3e0f32ca4cb9c39d595e66b610:/src/s4u/s4u_actor.cpp diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index de5b546865..48412257b0 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -151,6 +151,18 @@ void Actor::killAll(int resetPid) simcall_process_killall(resetPid); } +/** Retrieve the property value (or nullptr if not set) */ +const char* Actor::property(const char* key) +{ + return (char*)xbt_dict_get_or_null(simcall_process_get_properties(pimpl_), 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); + }); +} + // ***** this_actor ***** namespace this_actor {