From e50cb6ad58bf49c4bcd086ae0462c79e070e5cf2 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Sun, 28 Jan 2018 16:11:45 +0100 Subject: [PATCH] [S4U API] Expose the isDaemon() function to the API --- include/simgrid/s4u/Actor.hpp | 3 +++ src/s4u/s4u_actor.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 147f538aa3..2a77e8e3cb 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -204,6 +204,9 @@ public: /** This actor will be automatically terminated when the last non-daemon actor finishes **/ void daemonize(); + /** Returns whether or not this actor has been daemonized or not **/ + bool isDaemon(); + /** Retrieves the name of that actor as a C++ string */ const simgrid::xbt::string& getName() const; /** Retrieves the name of that actor as a C string */ diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index a81f54a2e7..57a78fed3f 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -111,6 +111,11 @@ void Actor::daemonize() simgrid::simix::kernelImmediate([this]() { pimpl_->daemonize(); }); } +bool Actor::isDaemon() +{ + return this->pimpl_->isDaemon(); +} + const simgrid::xbt::string& Actor::getName() const { return this->pimpl_->getName(); -- 2.20.1