From: Gabriel Corona Date: Wed, 22 Jun 2016 15:04:05 +0000 (+0200) Subject: Merge get-pid X-Git-Tag: v3_14~892^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3035b7175bbe5d672be9d9068016a2fb2613eb23?hp=0319431d6c2e70971f907c27e584d194104c7bb3 Merge get-pid --- 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()); +} + } } }