X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84e824746638f2b4c32c315bcfce655098d4e80b..3c6d61c2bd982819b041235ef2d5fa141c35e7f2:/include/simgrid/s4u/Exec.hpp diff --git a/include/simgrid/s4u/Exec.hpp b/include/simgrid/s4u/Exec.hpp index ecfa6cec59..d1c62eff20 100644 --- a/include/simgrid/s4u/Exec.hpp +++ b/include/simgrid/s4u/Exec.hpp @@ -52,6 +52,12 @@ public: Exec* wait() override; Exec* wait_for(double timeout) override; + /*! 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 int wait_any(std::vector* execs) { return wait_any_for(execs, -1); } + /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/ + static int wait_any_for(std::vector* execs, double timeout); + bool test() override; ExecPtr set_bound(double bound); @@ -60,6 +66,8 @@ public: ExecPtr set_tracing_category(const std::string& category); ExecPtr set_timeout(double timeout); Exec* cancel() override; + std::string get_name() const { return name_; } + const char* get_cname() const { return name_.c_str(); } XBT_ATTRIB_DEPRECATED_v324("Please use Exec::wait_for()") void wait(double t) override { wait_for(t); } };