Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to fix a failure about mutex freed too early in RMA
[simgrid.git] / src / kernel / activity / MutexImpl.hpp
index cad25c3..75cb5d6 100644 (file)
@@ -55,6 +55,7 @@ public:
   MutexImplPtr get_mutex() { return mutex_; }
   actor::ActorImpl* get_issuer() { return issuer_; }
   void grant() { granted_ = true; }
+  bool is_granted() { return granted_; }
 
   bool test(actor::ActorImpl* issuer = nullptr) override;
   void wait_for(actor::ActorImpl* issuer, double timeout) override;
@@ -99,7 +100,8 @@ public:
   {
     if (mutex->refcount_.fetch_sub(1) == 1) {
       xbt_assert(mutex->ongoing_acquisitions_.empty(), "The destroyed mutex still had ongoing acquisitions");
-      xbt_assert(mutex->owner_ == nullptr, "The destroyed mutex is still owned by %s", mutex->owner_->get_cname());
+      xbt_assert(mutex->owner_ == nullptr, "The destroyed mutex is still owned by actor %s",
+                 mutex->owner_->get_cname());
       delete mutex;
     }
   }