Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move parts of the kernel to the right subdir
[simgrid.git] / src / s4u / s4u_mutex.cpp
index e64bfd4..ba83148 100644 (file)
@@ -6,24 +6,33 @@
 
 #include "xbt/log.h"
 #include "src/msg/msg_private.h"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/smx_synchro_private.h"
 
-#include "simgrid/s4u/mutex.hpp"
+#include "simgrid/s4u/Mutex.hpp"
 
 namespace simgrid {
 namespace s4u {
 
-void Mutex::lock() {
+void Mutex::lock()
+{
   simcall_mutex_lock(mutex_);
 }
 
-void Mutex::unlock() {
+void Mutex::unlock()
+{
   simcall_mutex_unlock(mutex_);
 }
 
-bool Mutex::try_lock() {
+bool Mutex::try_lock()
+{
   return simcall_mutex_trylock(mutex_);
 }
 
+MutexPtr Mutex::createMutex()
+{
+  smx_mutex_t mutex = simcall_mutex_init();
+  return MutexPtr(&mutex->mutex(), false);
+}
+
 }
 }