Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] Allocate Mutex on the heap and return MutexPtr
[simgrid.git] / src / simix / smx_synchro_private.h
index 73f87c1..338a0b4 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <atomic>
 
+#include <simgrid/s4u/mutex.hpp>
+
 #include "xbt/base.h"
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
@@ -48,8 +50,12 @@ public:
     if (count == 0)
       delete mutex;
   }
+
+  simgrid::s4u::Mutex& mutex() { return mutex_; }
+
 private:
   std::atomic_int_fast32_t refcount_ { 1 };
+  simgrid::s4u::Mutex mutex_;
 };
 
 }