Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Completely remove detached comms when they are finished.
[simgrid.git] / src / kernel / activity / MutexImpl.hpp
index 1c23357..3f80092 100644 (file)
@@ -11,9 +11,7 @@
 #include "src/kernel/actor/ActorImpl.hpp"
 #include <boost/intrusive/list.hpp>
 
-namespace simgrid {
-namespace kernel {
-namespace activity {
+namespace simgrid::kernel::activity {
 
 /** Mutex Acquisition: the act / process of acquiring the mutex.
  *
@@ -65,15 +63,14 @@ class XBT_PUBLIC MutexImpl {
   std::atomic_int_fast32_t refcount_{1};
   s4u::Mutex piface_;
   actor::ActorImpl* owner_ = nullptr;
-  // List of sleeping actors:
-  std::deque<MutexAcquisitionImplPtr> sleeping_;
+  std::deque<MutexAcquisitionImplPtr> ongoing_acquisitions_;
   static unsigned next_id_;
-  unsigned id_;
+  unsigned id_ = next_id_++;
 
   friend MutexAcquisitionImpl;
 
 public:
-  MutexImpl() : piface_(this), id_(next_id_++) {}
+  MutexImpl() : piface_(this) {}
   MutexImpl(MutexImpl const&) = delete;
   MutexImpl& operator=(MutexImpl const&) = delete;
 
@@ -99,7 +96,5 @@ public:
 
   s4u::Mutex& mutex() { return piface_; }
 };
-} // namespace activity
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::activity
 #endif