From f997dd57c10e92aaed05832c96db7348d0da87ed Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 26 Sep 2017 11:38:02 +0200 Subject: [PATCH] Allow to specify a cleanup handler for detached comms. --- include/simgrid/s4u/Comm.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/simgrid/s4u/Comm.hpp b/include/simgrid/s4u/Comm.hpp index dcb0e17745..ff9f2685ad 100644 --- a/include/simgrid/s4u/Comm.hpp +++ b/include/simgrid/s4u/Comm.hpp @@ -102,6 +102,12 @@ public: /** Start the comm, and ignore its result. It can be completely forgotten after that. */ void detach(); + /** Start the comm, and ignore its result. It can be completely forgotten after that. */ + void detach(void (*cleanFunction)(void*)) + { + cleanFunction_ = cleanFunction; + detach(); + } /** Sets the maximal communication rate (in byte/sec). Must be done before start */ void setRate(double rate); -- 2.20.1