X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f6940b14610d1ac8f34a2e35572c1db33920c0c4..db176451b42c9d524f82e6bb9951447e098dd492:/include/simgrid/s4u/Actor.hpp?ds=sidebyside diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index e57c18555a..58e1b4b76e 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -220,6 +220,12 @@ public: /** If set to true, the actor will automatically restart when its host reboots */ void setAutoRestart(bool autorestart); + + /** Add a function to the list of "on_exit" functions for the current actor. The on_exit functions are the functions + * executed when your actor is killed. You should use them to free the data used by your process. + */ + void onExit(int_f_pvoid_pvoid_t fun, void* data); + /** Sets the time at which that actor should be killed */ void setKillTime(double time); /** Retrieves the time at which that actor will be killed (or -1 if not set) */ @@ -249,6 +255,7 @@ public: /** Ask kindly to all actors to die. Only the issuer will survive. */ static void killAll(); + static void killAll(int resetPid); /** Returns the internal implementation of this actor */ simix::ActorImpl* getImpl(); @@ -317,6 +324,9 @@ namespace this_actor { /** @brief kill the actor. */ XBT_PUBLIC(void) kill(); + /** @brief Add a function to the list of "on_exit" functions. */ + XBT_PUBLIC(void) onExit(int_f_pvoid_pvoid_t fun, void* data); + /** @brief Migrate the actor to a new host. */ XBT_PUBLIC(void) migrate(Host* new_host); };