* See \ref Comm for the full communication API (including non blocking communications).
*/
XBT_PUBLIC(void*) recv(MailboxPtr chan);
+ XBT_PUBLIC(Comm&) irecv(MailboxPtr chan, void** data);
/** Block the actor until it delivers a message of the given simulated size to the given mailbox
*
* See \ref Comm for the full communication API (including non blocking communications).
*/
XBT_PUBLIC(void) send(MailboxPtr chan, void* payload, double simulatedSize);
+ XBT_PUBLIC(void) send(MailboxPtr chan, void* payload, double simulatedSize, double timeout);
XBT_PUBLIC(Comm&) isend(MailboxPtr chan, void* payload, double simulatedSize);
c.wait();
}
+void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
+{
+ Comm& c = Comm::send_init(chan);
+ c.setRemains(simulatedSize);
+ c.setSrcData(payload);
+ // c.start() is optional.
+ c.wait(timeout);
+}
+
Comm& isend(MailboxPtr chan, void* payload, double simulatedSize)
{
return Comm::send_async(chan, payload, simulatedSize);
}
+Comm& isend(MailboxPtr chan, void** data)
+{
+ return Comm::recv_async(chan, data);
+}
+
int pid()
{
return SIMIX_process_self()->pid;