Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Take simcalls {execution,io}_wait toward modernity.
[simgrid.git] / src / s4u / s4u_Exec.cpp
index 72ab238..227ab30 100644 (file)
@@ -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 (simcall_execution_test(get_impl())) {
-    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<void>([this, issuer, timeout] { this->get_impl()->wait_for(issuer, timeout); });
   state_ = State::FINISHED;
   on_completion(*Actor::self(), *this);
   this->release_dependencies();