X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0e091ffb1012adf948480d611dbff3701dd29b61..370d85c0bc1fd13c8444a243ecd4390012f5c246:/src/s4u/s4u_Comm.cpp?ds=sidebyside diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index 50eaf00d28..7eb4685229 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -167,6 +167,8 @@ Comm* Comm::wait_for(double timeout) state_ = State::FINISHED; return this; + case State::CANCELED: + return this; default: THROW_IMPOSSIBLE; } @@ -193,7 +195,10 @@ Comm* Comm::detach() Comm* Comm::cancel() { - simgrid::simix::simcall([this] { static_cast(pimpl_.get())->cancel(); }); + simgrid::simix::simcall([this] { + if (pimpl_) + boost::static_pointer_cast(pimpl_)->cancel(); + }); state_ = State::CANCELED; return this; }