X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4a4d0d50d8a6fbd0b50172905f7ad5cf5ed0f9a0..8a16d3b0a913a37d1346f472c1ccf727fb8fed15:/src/s4u/s4u_Exec.cpp diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index f443e16663..227ab302c3 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -20,26 +20,6 @@ Exec::Exec() pimpl_ = kernel::activity::ExecImplPtr(new kernel::activity::ExecImpl()); } -bool Exec::test() -{ - xbt_assert(state_ == State::INITED || state_ == State::STARTED || state_ == State::STARTING || - state_ == State::FINISHED); - - if (state_ == State::FINISHED) - return true; - - if (state_ == State::INITED || state_ == State::STARTING) - this->vetoable_start(); - - if (kernel::actor::simcall([this] { return this->get_impl()->test(); })) { - state_ = State::FINISHED; - this->release_dependencies(); - return true; - } - - return false; -} - Exec* Exec::wait() { return this->wait_for(-1); @@ -49,7 +29,9 @@ Exec* Exec::wait_for(double timeout) { if (state_ == State::INITED) vetoable_start(); - simcall_execution_wait(get_impl(), timeout); + + kernel::actor::ActorImpl* issuer = Actor::self()->get_impl(); + kernel::actor::simcall_blocking([this, issuer, timeout] { this->get_impl()->wait_for(issuer, timeout); }); state_ = State::FINISHED; on_completion(*Actor::self(), *this); this->release_dependencies();