From 33271d843f695e0a2707dd29158165898db73477 Mon Sep 17 00:00:00 2001 From: adfaure Date: Tue, 7 Jun 2016 09:52:20 +0200 Subject: [PATCH] [s4u] add actor join --- include/simgrid/s4u/actor.hpp | 5 +++++ src/s4u/s4u_actor.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index e96a862a4b..f479cf5144 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -77,6 +77,11 @@ public: static void kill(int pid); + /** + * Wait for the actor to finish. + */ + void join(); + // Static methods on all actors: /** Ask kindly to all actors to die. Only the issuer will survive. */ diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 4a58590436..37302a75d8 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -29,6 +29,10 @@ s4u::Actor::Actor(const char* name, s4u::Host *host, double killTime, std::funct s4u::Actor::~Actor() {} +void s4u::Actor::join() { + simcall_process_join(pimpl_, -1); +} + void s4u::Actor::setAutoRestart(bool autorestart) { simcall_process_auto_restart_set(pimpl_,autorestart); } -- 2.20.1