Bug 1050445 - Part 2: Add ClearAcquisitionState. r=froydnj

--HG--
extra : rebase_source : 0900c1663a9b06bbc68d757f20182513ceb4c35e
This commit is contained in:
Eric Rahm 2014-08-13 12:37:05 -07:00
parent eb0cc8edce
commit 525c4f41a3
2 changed files with 13 additions and 2 deletions

View File

@ -343,7 +343,7 @@ ReentrantMonitor::Wait(PRIntervalTime aInterval)
AcquisitionState savedAcquisitionState = GetAcquisitionState();
BlockingResourceBase* savedChainPrev = mChainPrev;
mEntryCount = 0;
SetAcquisitionState(false);
ClearAcquisitionState();
mChainPrev = 0;
nsresult rv;
@ -379,7 +379,7 @@ CondVar::Wait(PRIntervalTime aInterval)
// save mutex state and reset to empty
AcquisitionState savedAcquisitionState = mLock->GetAcquisitionState();
BlockingResourceBase* savedChainPrev = mLock->mChainPrev;
mLock->SetAcquisitionState(false);
mLock->ClearAcquisitionState();
mLock->mChainPrev = 0;
// give up mutex until we're back from Wait()

View File

@ -202,6 +202,17 @@ protected:
mAcquired = aAcquisitionState;
}
/**
* ClearAcquisitionState
* Indicate this resource is not acquired.
*
* *NOT* thread safe. Requires ownership of underlying resource.
*/
void ClearAcquisitionState()
{
mAcquired = false;
}
/**
* mChainPrev
* A series of resource acquisitions creates a chain of orders. This