X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d1ce25d36729721b7d7eed0fa4425e401db8a092..d68a0ac239494f0a1c7f21b7c195f453ee7a31eb:/src/s4u/s4u_comm.cpp diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index 547e39c424..8340bd320b 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -177,20 +177,21 @@ s4u::CommPtr Comm::recv_async(MailboxPtr dest, void** data) void Comm::cancel() { - simgrid::kernel::activity::CommImpl* commPimpl = static_cast(pimpl_); + simgrid::kernel::activity::CommImplPtr commPimpl = + boost::static_pointer_cast(pimpl_); commPimpl->cancel(); } bool Comm::test() { xbt_assert(state_ == inited || state_ == started || state_ == finished); - - if (state_ == finished) + + if (state_ == finished) xbt_die("Don't call test on a finished comm."); - + if (state_ == inited) { this->start(); } - + if(simcall_comm_test(pimpl_)){ state_ = finished; pimpl_->unref();