From 011253ac4789fc114fccbf875b5f48c2bb7d7a13 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 25 Oct 2017 22:35:12 +0200 Subject: [PATCH] Display lock and wait counts. --- server/TracyView.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 3c8e6343..990d1e37 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2380,11 +2380,25 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, switch( state ) { case State::HasLock: - ImGui::Text( "Thread \"%s\" has lock. No other threads are waiting.", GetThreadString( tid ) ); + if( (*vbegin)->lockCount == 1 ) + { + ImGui::Text( "Thread \"%s\" has lock. No other threads are waiting.", GetThreadString( tid ) ); + } + else + { + ImGui::Text( "Thread \"%s\" has %i locks. No other threads are waiting.", GetThreadString( tid ), (*vbegin)->lockCount ); + } break; case State::HasBlockingLock: { - ImGui::Text( "Thread \"%s\" has lock. Other threads are blocked:", GetThreadString( tid ) ); + if( (*vbegin)->lockCount == 1 ) + { + ImGui::Text( "Thread \"%s\" has lock. Blocked threads (%i):", GetThreadString( tid ), CountBits( (*vbegin)->waitList ) ); + } + else + { + ImGui::Text( "Thread \"%s\" has %i locks. Blocked threads (%i):", GetThreadString( tid ), (*vbegin)->lockCount, CountBits( (*vbegin)->waitList ) ); + } auto waitList = (*vbegin)->waitList; int t = 0; while( waitList != 0 )