Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] add this_actor::getPid()
authoradfaure <adrien.faure2@gmail.com>
Wed, 22 Jun 2016 14:57:47 +0000 (16:57 +0200)
committeradfaure <adrien.faure2@gmail.com>
Wed, 22 Jun 2016 14:57:47 +0000 (16:57 +0200)
include/simgrid/s4u/actor.hpp
src/s4u/s4u_actor.cpp

index 052ad86..9b38309 100644 (file)
@@ -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);
    * 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();
 
 };
 
 
 };
 
index ca6cfec..1a97502 100644 (file)
@@ -122,6 +122,10 @@ void send(Mailbox &chan, void *payload, size_t simulatedSize) {
   c.wait();
 }
 
   c.wait();
 }
 
+int getPid() {
+  return simcall_process_get_PID(SIMIX_process_self());
+}
+
 }
 }
 }
 }
 }
 }