* See \ref Comm for the full communication API (including non blocking communications).
*/
XBT_PUBLIC(void*) recv(MailboxPtr chan);
+ XBT_PUBLIC(void*) recv(MailboxPtr chan, double timeout);
XBT_PUBLIC(CommPtr) irecv(MailboxPtr chan, void** data);
/** Block the actor until it delivers a message of the given simulated size to the given mailbox
return res;
}
+void* recv(MailboxPtr chan, double timeout)
+{
+ void* res = nullptr;
+ CommPtr c = Comm::recv_init(chan);
+ c->setDstData(&res, sizeof(res));
+ c->wait(timeout);
+ return res;
+}
+
void send(MailboxPtr chan, void* payload, double simulatedSize)
{
CommPtr c = Comm::send_init(chan);