Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add sg_comm_detach with cleaning function
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 16 Mar 2020 08:26:21 +0000 (09:26 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 16 Mar 2020 08:26:21 +0000 (09:26 +0100)
include/simgrid/comm.h
src/s4u/s4u_Comm.cpp

index 69d4490..d99cbbf 100644 (file)
@@ -12,6 +12,7 @@
 /* C interface */
 SG_BEGIN_DECL
 
+XBT_PUBLIC void sg_comm_detach(sg_comm_t comm, void (*clean_function)(void*));
 XBT_PUBLIC int sg_comm_test(sg_comm_t comm);
 XBT_PUBLIC sg_error_t sg_comm_wait(sg_comm_t comm);
 XBT_PUBLIC sg_error_t sg_comm_wait_for(sg_comm_t comm, double timeout);
index 799dc41..f348f68 100644 (file)
@@ -255,6 +255,11 @@ Actor* Comm::get_sender() const
 } // namespace s4u
 } // namespace simgrid
 /* **************************** Public C interface *************************** */
+void sg_comm_detach(sg_comm_t comm, void (*clean_function)(void*))
+{
+  comm = comm->detach(clean_function);
+}
+
 int sg_comm_test(sg_comm_t comm)
 {
   bool finished = comm->test();