From 5341c1e69bb03075ba5c9e5d250ed08788f8ba5b Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Wed, 15 Jun 2016 15:00:04 +0200 Subject: [PATCH 1/1] [simix] Fix refcount in Mutex --- src/simix/smx_synchro_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simix/smx_synchro_private.h b/src/simix/smx_synchro_private.h index 802716a13d..21e76b467c 100644 --- a/src/simix/smx_synchro_private.h +++ b/src/simix/smx_synchro_private.h @@ -36,13 +36,13 @@ public: // boost::intrusive_ptr support: friend void intrusive_ptr_add_ref(Mutex* mutex) { - auto previous = ++mutex->refcount_; + auto previous = (mutex->refcount_)++; xbt_assert(previous != 0); (void) previous; } friend void intrusive_ptr_release(Mutex* mutex) { - auto count = mutex->refcount_--; + auto count = --(mutex->refcount_); if (count == 0) delete mutex; } -- 2.20.1