+ unref comm is test return true
SG_BEGIN_DECL
XBT_PUBLIC int sg_comm_test(sg_comm_t comm);
+XBT_PUBLIC void sg_comm_wait(sg_comm_t comm);
XBT_PUBLIC void sg_comm_wait_all(sg_comm_t* comms, size_t count);
XBT_PUBLIC int sg_comm_wait_any_for(sg_comm_t* comms, size_t count, double timeout);
XBT_PUBLIC int sg_comm_wait_any(sg_comm_t* comms, size_t count);
/* **************************** 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)