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:
Robert Osfield
2006-09-15 10:21:24 +00:00
parent 6f3962f42d
commit fa76f7e973

View File

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