Full dequeue is needed to handle symbol queries.

This commit is contained in:
Bartosz Taudul 2021-11-14 19:24:05 +01:00
parent 1575455a54
commit 590a4afb89
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1921,8 +1921,6 @@ void Profiler::Worker()
} }
// Handle remaining server queries // Handle remaining server queries
for(;;) for(;;)
{
if( m_sock->HasData() )
{ {
while( m_sock->HasData() ) while( m_sock->HasData() )
{ {
@ -1941,8 +1939,13 @@ void Profiler::Worker()
m_symbolQueue.pop(); m_symbolQueue.pop();
} }
#endif #endif
while( Dequeue( token ) == DequeueStatus::DataDequeued ) {} const auto status = Dequeue( token );
while( DequeueSerial() == DequeueStatus::DataDequeued ) {} const auto serialStatus = DequeueSerial();
if( status == DequeueStatus::ConnectionLost || serialStatus == DequeueStatus::ConnectionLost )
{
m_shutdownFinished.store( true, std::memory_order_relaxed );
return;
}
if( m_bufferOffset != m_bufferStart ) if( m_bufferOffset != m_bufferStart )
{ {
if( !CommitData() ) if( !CommitData() )
@ -1952,12 +1955,6 @@ void Profiler::Worker()
} }
} }
} }
else
{
if( m_bufferOffset != m_bufferStart ) CommitData();
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}
}
} }
#ifndef TRACY_NO_FRAME_IMAGE #ifndef TRACY_NO_FRAME_IMAGE