From: adfaure Date: Wed, 22 Jun 2016 14:57:47 +0000 (+0200) Subject: [s4u] add this_actor::getPid() X-Git-Tag: v3_14~892^2^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1e063a94dba49a1314cfbcdceb33fa6ed0dc3130 [s4u] add this_actor::getPid() --- diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index 052ad862e5..9b38309464 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -277,6 +277,11 @@ namespace this_actor { * See \ref Comm for the full communication API (including non blocking communications). */ XBT_PUBLIC(void) send(Mailbox &chan, void*payload, size_t simulatedSize); + + /** + * Return the PID of the current actor. + */ + XBT_PUBLIC(int) getPid(); }; diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index ca6cfec3d0..1a97502d0e 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -122,6 +122,10 @@ void send(Mailbox &chan, void *payload, size_t simulatedSize) { c.wait(); } +int getPid() { + return simcall_process_get_PID(SIMIX_process_self()); +} + } } }