Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add send with timeout and irecv to this_actor API
[simgrid.git] / src / s4u / s4u_actor.cpp
index c1c7ed2..570c181 100644 (file)
@@ -190,9 +190,23 @@ void send(MailboxPtr chan, void* payload, double simulatedSize)
   c.wait();
 }
 
-void isend(MailboxPtr chan, void* payload, double simulatedSize)
+void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
 {
-  Comm::send_async(chan, payload, simulatedSize);
+  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()