- static xbt::signal<void(Exec const&)> on_start;
- static xbt::signal<void(Exec const&)> on_completion;
+ /*! Signal fired each time that an execution actually starts (no veto) */
+ static void on_start_cb(const std::function<void(Exec const&)>& cb) { on_start.connect(cb); }
+
+ static ExecPtr init();
+
+ /*! take a vector of s4u::ExecPtr and return when one of them is finished.
+ * The return value is the rank of the first finished ExecPtr. */
+ static ssize_t wait_any(const std::vector<ExecPtr>& execs) { return wait_any_for(execs, -1); }
+ /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
+ static ssize_t wait_any_for(const std::vector<ExecPtr>& execs, double timeout);