Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add detached isend to maestro to allow tracking in case of fault
[simgrid.git] / src / kernel / activity / MutexImpl.hpp
index 347880d..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.
  *
@@ -41,8 +39,7 @@ namespace activity {
  * of a set if some transitions may become disabled in between, while you don't have to reconsider them if you can reuse
  * your previous computations).
  */
-class XBT_PUBLIC MutexAcquisitionImpl
-    : public ActivityImpl_T<MutexAcquisitionImpl> { // Acquisition: n. The act or process of acquiring.
+class XBT_PUBLIC MutexAcquisitionImpl : public ActivityImpl_T<MutexAcquisitionImpl> {
   actor::ActorImpl* issuer_ = nullptr;
   MutexImpl* mutex_         = nullptr;
 
@@ -66,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;
 
@@ -100,7 +96,5 @@ public:
 
   s4u::Mutex& mutex() { return piface_; }
 };
-} // namespace activity
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::activity
 #endif