Show which threads are blocking/blocked.

This commit is contained in:
Bartosz Taudul 2017-10-05 23:47:51 +02:00
parent 182f6533f3
commit b965a1c936

View File

@ -1660,11 +1660,36 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
ImGui::Text( "Thread \"%s\" has lock. No other threads are waiting.", GetThreadString( tid ) ); ImGui::Text( "Thread \"%s\" has lock. No other threads are waiting.", GetThreadString( tid ) );
break; break;
case State::HasBlockingLock: case State::HasBlockingLock:
ImGui::Text( "Thread \"%s\" has lock. Other threads are blocked.", GetThreadString( tid ) ); {
ImGui::Text( "Thread \"%s\" has lock. Other threads are blocked:", GetThreadString( tid ) );
auto it = next;
do
{
--it;
if( (*it)->type == LockEvent::Type::Wait )
{
ImGui::Text( "\"%s\"", GetThreadString( (*it)->thread ) );
}
}
while( it != vbegin );
break; break;
}
case State::WaitLock: case State::WaitLock:
ImGui::Text( "Thread \"%s\" is blocked by other threads.", GetThreadString( tid ) ); {
ImGui::Text( "Thread \"%s\" is blocked by other thread:", GetThreadString( tid ) );
auto it = vbegin;
--it;
for(;;)
{
if( (*it)->type == LockEvent::Type::Obtain )
{
ImGui::Text( "\"%s\"", GetThreadString( (*it)->thread ) );
break;
}
--it;
}
break; break;
}
default: default:
assert( false ); assert( false );
break; break;