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.
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)