Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further cut include files
[simgrid.git] / src / s4u / s4u_mutex.cpp
index 7e0e852..09d3654 100644 (file)
@@ -1,13 +1,10 @@
-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/msg/msg_private.hpp"
-#include "src/simix/smx_synchro_private.hpp"
-#include "xbt/log.h"
-
 #include "simgrid/s4u/Mutex.hpp"
+#include "src/kernel/activity/MutexImpl.hpp"
 
 namespace simgrid {
 namespace s4u {
@@ -43,5 +40,16 @@ MutexPtr Mutex::createMutex()
   return MutexPtr(&mutex->mutex(), false);
 }
 
+/* refcounting of the intrusive_ptr is delegated to the implementation object */
+void intrusive_ptr_add_ref(Mutex* mutex)
+{
+  xbt_assert(mutex);
+  SIMIX_mutex_ref(mutex->mutex_);
+}
+void intrusive_ptr_release(Mutex* mutex)
+{
+  xbt_assert(mutex);
+  SIMIX_mutex_unref(mutex->mutex_);
+}
 }
 }