Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last call to MSG_hosts_as_dynar -> deprecate !
[simgrid.git] / src / s4u / s4u_Comm.cpp
index 799dc41..4d5bb78 100644 (file)
@@ -249,12 +249,24 @@ Mailbox* Comm::get_mailbox() const
 
 Actor* Comm::get_sender() const
 {
-  return sender_ ? sender_->ciface() : nullptr;
+  kernel::actor::ActorImplPtr sender = nullptr;
+  if (pimpl_)
+    sender = boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->src_actor_;
+  return sender ? sender->ciface() : nullptr;
 }
 
 } // namespace s4u
 } // namespace simgrid
 /* **************************** Public C interface *************************** */
+void sg_comm_detach(sg_comm_t comm, void (*clean_function)(void*))
+{
+  comm->detach(clean_function);
+  comm->unref();
+}
+void sg_comm_unref(sg_comm_t comm)
+{
+  comm->unref();
+}
 int sg_comm_test(sg_comm_t comm)
 {
   bool finished = comm->test();