X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1e5e4a470ede08f4055218978210e6c6e7fb751a..cb6448e71a64791c262d6c40c050cc0b8d8ed184:/include/simgrid/simix/blocking_simcall.hpp diff --git a/include/simgrid/simix/blocking_simcall.hpp b/include/simgrid/simix/blocking_simcall.hpp index 2e26f0a2ba..f7f233c046 100644 --- a/include/simgrid/simix/blocking_simcall.hpp +++ b/include/simgrid/simix/blocking_simcall.hpp @@ -113,8 +113,10 @@ public: } void wait() { - if (!valid()) - throw std::future_error(std::future_errc::no_state); + // The future is ready! We don't have to wait: + if (this->is_ready()) + return; + // The future is not ready. We have to delegate to the SimGrid kernel: std::exception_ptr exception; smx_process_t self = SIMIX_process_self(); simcall_run_blocking([this, &exception, self]{