- // Not found:
- if (idx == -1)
- return last;
- // Lift the index to the corresponding iterator:
- auto res = std::next(first, idx);
- (*res)->state_ = finished;
- return res;
+ return idx;
+ }
+
+ /*! take a vector s4u::CommPtr and return when all of them is finished. */
+ static void wait_all(std::vector<CommPtr> * comms)
+ {
+ // TODO: this should be a simcall or something
+ // TODO: we are missing a version with timeout
+ for (CommPtr comm : *comms) {
+ comm->wait();
+ }
+ }
+
+ /** Creates (but don't start) an async send to the mailbox @p dest */
+ XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+ send_init(MailboxPtr dest)
+ {
+ return dest->put_init();