From e16f784617b3f2fd8f8dfbc70080ab29a3c214e9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 25 Oct 2017 23:30:51 +0200 Subject: [PATCH] Proper handling of recursive mutices. --- server/TracyView.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 67680224..d73256d6 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2182,7 +2182,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, { if( (*vbegin)->lockingThread == thread ) { - if( (*vbegin)->waitList == 0 ) + if( ( (*vbegin)->waitList & ~( uint64_t( 1 ) << thread ) ) == 0 ) { state = State::HasLock; } @@ -2212,7 +2212,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, { if( (*next)->lockingThread == thread ) { - if( (*next)->waitList == 0 ) + if( ( (*next)->waitList & ~( uint64_t( 1 ) << thread ) ) == 0 ) { nextState = State::HasLock; break; @@ -2243,7 +2243,10 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, } if( (*next)->waitList != 0 ) { - nextState = State::HasBlockingLock; + if( ( (*next)->waitList & ~( uint64_t( 1 ) << thread ) ) != 0 ) + { + nextState = State::HasBlockingLock; + } break; } next++; @@ -2271,7 +2274,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, { if( (*next)->lockingThread == thread ) { - if( (*next)->waitList == 0 ) + if( ( (*next)->waitList & ~( uint64_t( 1 ) << thread ) ) == 0 ) { nextState = State::HasLock; break;