1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 22:13:51 +00:00

Combine wait lists.

This commit is contained in:
Bartosz Taudul 2017-12-10 23:33:39 +01:00
parent 340506406e
commit 6f1a99e270

View File

@ -2859,12 +2859,13 @@ static Vector<LockEvent*>::iterator GetNextLockEvent( const Vector<LockEvent*>::
{ {
if( (*next)->lockCount != 0 ) if( (*next)->lockCount != 0 )
{ {
const auto wait = (*next)->waitList | (*next)->waitShared;
if( GetThreadBit( (*next)->lockingThread ) == threadBit ) if( GetThreadBit( (*next)->lockingThread ) == threadBit )
{ {
nextState = ( AreOtherWaiting( (*next)->waitList, threadBit ) || AreOtherWaiting( (*next)->waitShared, threadBit ) ) ? LockState::HasBlockingLock : LockState::HasLock; nextState = AreOtherWaiting( wait, threadBit ) ? LockState::HasBlockingLock : LockState::HasLock;
break; break;
} }
else if( IsThreadWaiting( (*next)->waitList, threadBit ) || IsThreadWaiting( (*next)->waitShared, threadBit ) ) else if( IsThreadWaiting( wait, threadBit ) )
{ {
nextState = LockState::WaitLock; nextState = LockState::WaitLock;
break; break;
@ -2931,7 +2932,8 @@ static Vector<LockEvent*>::iterator GetNextLockEvent( const Vector<LockEvent*>::
{ {
if( GetThreadBit( (*next)->lockingThread ) == threadBit ) if( GetThreadBit( (*next)->lockingThread ) == threadBit )
{ {
nextState = ( AreOtherWaiting( (*next)->waitList, threadBit ) || AreOtherWaiting( (*next)->waitShared, threadBit ) ) ? LockState::HasBlockingLock : LockState::HasLock; const auto wait = (*next)->waitList | (*next)->waitShared;
nextState = AreOtherWaiting( wait, threadBit ) ? LockState::HasBlockingLock : LockState::HasLock;
break; break;
} }
if( IsThreadWaiting( (*next)->sharedList, threadBit ) ) if( IsThreadWaiting( (*next)->sharedList, threadBit ) )