Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to specify a cleanup handler for detached comms.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 26 Sep 2017 09:38:02 +0000 (11:38 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 26 Sep 2017 12:47:16 +0000 (14:47 +0200)
include/simgrid/s4u/Comm.hpp

index dcb0e17..ff9f268 100644 (file)
@@ -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();
+  /** 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);
 
   /** Sets the maximal communication rate (in byte/sec). Must be done before start */
   void setRate(double rate);