X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ab5892145873c4600038ad2561a9800f994e4c35..09672882edafb2d47c31b4c3e45543cc5ede5827:/src/s4u/s4u_Comm.cpp diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index c2dc1f13e9..bf135b4d04 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -257,7 +257,16 @@ Actor* Comm::get_sender() const /* **************************** Public C interface *************************** */ int sg_comm_test(sg_comm_t comm) { - return comm->test(); + bool finished = comm->test(); + if (finished) + comm->unref(); + return finished; +} + +void sg_comm_wait(sg_comm_t comm) +{ + comm->wait_for(-1); + comm->unref(); } void sg_comm_wait_all(sg_comm_t* comms, size_t count)