X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5f11cdef5b0309cb622f9280488f85fa213e8c1f..be3155e24d0c71e2bbd31dd282cfd49bff7290fa:/include/simgrid/s4u/mutex.hpp diff --git a/include/simgrid/s4u/mutex.hpp b/include/simgrid/s4u/mutex.hpp index da7c3df863..201f0710a9 100644 --- a/include/simgrid/s4u/mutex.hpp +++ b/include/simgrid/s4u/mutex.hpp @@ -20,14 +20,14 @@ XBT_PUBLIC_CLASS Mutex { public: Mutex() : mutex_(simcall_mutex_init()) {} - Mutex(simgrid::simix::Mutex* mutex) : mutex_(SIMIX_mutex_dup(mutex)) {} + Mutex(simgrid::simix::Mutex* mutex) : mutex_(SIMIX_mutex_ref(mutex)) {} ~Mutex() { - SIMIX_mutex_destroy(mutex_); + SIMIX_mutex_unref(mutex_); } // Copy+move (with the copy-and-swap idiom): - Mutex(Mutex const& mutex) : mutex_(SIMIX_mutex_dup(mutex.mutex_)) {} + Mutex(Mutex const& mutex) : mutex_(SIMIX_mutex_ref(mutex.mutex_)) {} friend void swap(Mutex& first, Mutex& second) { using std::swap;