Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Call CommImpl::set_iface(nullptr) as soon as the comm is finished, and make TSan...
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Jun 2023 07:55:07 +0000 (09:55 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Jun 2023 13:54:47 +0000 (15:54 +0200)
src/kernel/activity/CommImpl.cpp
src/s4u/s4u_Comm.cpp

index 5dedf54..7452071 100644 (file)
@@ -470,6 +470,7 @@ void CommImpl::finish()
 
   if (get_iface()) {
     const auto& piface = static_cast<const s4u::Comm&>(*get_iface());
+    set_iface(nullptr); // reset iface to protect against multiple trigger of the on_completion signals
     s4u::Comm::on_completion(piface);
     piface.on_this_completion(piface);
   }
index f7bfc9e..a6ada2f 100644 (file)
@@ -58,8 +58,6 @@ Comm::~Comm()
       XBT_INFO("pimpl_ is null");
     xbt_backtrace_display_current();
   }
-  if (pimpl_ != nullptr)
-    pimpl_->set_iface(nullptr);
 }
 
 void Comm::send(kernel::actor::ActorImpl* sender, const Mailbox* mbox, double task_size, double rate, void* src_buff,