diff --git a/common/src/Utilities/Mutex.cpp b/common/src/Utilities/Mutex.cpp index 9822b3bb21..246387f805 100644 --- a/common/src/Utilities/Mutex.cpp +++ b/common/src/Utilities/Mutex.cpp @@ -120,7 +120,7 @@ Threading::Mutex::~Mutex() throw() Threading::MutexRecursive::MutexRecursive() : Mutex( false ) { - if( _attr_refcount.fetch_add(1) == 1 ) + if( ++_attr_refcount == 1 ) { if( 0 != pthread_mutexattr_init( &_attr_recursive ) ) throw Exception::OutOfMemory(L"Recursive mutexing attributes"); @@ -134,7 +134,7 @@ Threading::MutexRecursive::MutexRecursive() : Mutex( false ) Threading::MutexRecursive::~MutexRecursive() throw() { - if( _attr_refcount.fetch_sub(1) == 0 ) + if( --_attr_refcount == 0 ) pthread_mutexattr_destroy( &_attr_recursive ); }