Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
first attempt (ongoing WIP)
[simgrid.git] / src / s4u / s4u_comm.cpp
index 547e39c..8340bd3 100644 (file)
@@ -177,20 +177,21 @@ s4u::CommPtr Comm::recv_async(MailboxPtr dest, void** data)
 
 void Comm::cancel()
 {
-  simgrid::kernel::activity::CommImpl* commPimpl = static_cast<simgrid::kernel::activity::CommImpl*>(pimpl_);
+  simgrid::kernel::activity::CommImplPtr commPimpl =
+      boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(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();