Added a _threadHoldingMutex = 0; to ReentrantMutex::unlock() to avoid a potential
bug with the mutex being aquired by two threads.
This commit is contained in:
@@ -51,7 +51,11 @@ int ReentrantMutex::unlock()
|
||||
if (_threadHoldingMutex==OpenThreads::Thread::CurrentThread() && _lockCount>0)
|
||||
{
|
||||
--_lockCount;
|
||||
if (_lockCount<=0) return Mutex::unlock();
|
||||
if (_lockCount<=0)
|
||||
{
|
||||
_threadHoldingMutex = 0;
|
||||
return Mutex::unlock();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user