Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / xbt / xbt_os_synchro.cpp
index d8544dc..ecfe134 100644 (file)
@@ -1,6 +1,6 @@
 /* Classical synchro schema, implemented on top of SimGrid                  */
 
-/* Copyright (c) 2007-2018. The SimGrid Team.
+/* Copyright (c) 2007-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,10 +9,9 @@
 #include "simgrid/Exception.hpp"
 #include "simgrid/simix.h" /* used implementation */
 #include "src/kernel/activity/ConditionVariableImpl.hpp"
+#include "src/kernel/activity/MutexImpl.hpp"
 #include "xbt/synchro.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt, "Synchronization mechanism");
-
 /****** mutex related functions ******/
 xbt_mutex_t xbt_mutex_init(void)
 {
@@ -36,7 +35,8 @@ void xbt_mutex_release(xbt_mutex_t mutex)
 
 void xbt_mutex_destroy(xbt_mutex_t mutex)
 {
-  SIMIX_mutex_unref((smx_mutex_t)mutex);
+  if (mutex != nullptr)
+    mutex->unref();
 }
 
 /***** condition related functions *****/