Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix ActivityImpl::wait_for to not cancel the activity on timeout.
[simgrid.git] / src / s4u / s4u_Comm.cpp
index 039dbc8..b0c22d8 100644 (file)
@@ -182,12 +182,6 @@ Comm* Comm::start()
   return this;
 }
 
-/** @brief Block the calling actor until the communication is finished */
-Comm* Comm::wait()
-{
-  return this->wait_for(-1);
-}
-
 /** @brief Block the calling actor until the communication is finished, or until timeout
  *
  * On timeout, an exception is thrown and the communication is invalidated.
@@ -251,22 +245,12 @@ Comm* Comm::detach()
   return this;
 }
 
-Comm* Comm::cancel()
-{
-  kernel::actor::simcall([this] {
-    if (pimpl_)
-      boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->cancel();
-  });
-  complete(State::CANCELED);
-  return this;
-}
-
-bool Comm::test()
+bool Comm::test() // TODO: merge with Activity::test, once modernized
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTED || state_ == State::STARTING ||
-             state_ == State::FINISHED);
+             state_ == State::CANCELED || state_ == State::FINISHED);
 
-  if (state_ == State::FINISHED)
+  if (state_ == State::CANCELED || state_ == State::FINISHED)
     return true;
 
   if (state_ == State::INITED || state_ == State::STARTING)