Merge pull request #1211 from PCSX2/atomix-fetch-correction

Core|Common: restore old interlocked add/sub behavior
This commit is contained in:
Gregory Hainaut 2016-02-29 22:29:54 +01:00
commit 883963232f
1 changed files with 2 additions and 2 deletions

View File

@ -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 );
}