Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Close file after use.
[simgrid.git] / src / s4u / s4u_Comm.cpp
index 33c613e..bf135b4 100644 (file)
@@ -255,6 +255,20 @@ Actor* Comm::get_sender() const
 } // namespace s4u
 } // namespace simgrid
 /* **************************** Public C interface *************************** */
+int sg_comm_test(sg_comm_t comm)
+{
+  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)
 {
   std::vector<simgrid::s4u::CommPtr> s4u_comms;