mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 08:54:34 +00:00
Wait on HasData condition to avoid infinite loop.
Tracy worker resets the IsConnected to false when finishing the capture. If it finishes too quick, the waiting loop in capture.cpp might never see IsConnected = true.
This commit is contained in:
parent
d47122586c
commit
ceb474e072
@ -159,7 +159,7 @@ int main( int argc, char** argv )
|
|||||||
printf( "Connecting to %s:%i...", address, port );
|
printf( "Connecting to %s:%i...", address, port );
|
||||||
fflush( stdout );
|
fflush( stdout );
|
||||||
tracy::Worker worker( address, port );
|
tracy::Worker worker( address, port );
|
||||||
while( !worker.IsConnected() )
|
while( !worker.HasData() )
|
||||||
{
|
{
|
||||||
const auto handshake = worker.GetHandshakeStatus();
|
const auto handshake = worker.GetHandshakeStatus();
|
||||||
if( handshake == tracy::HandshakeProtocolMismatch )
|
if( handshake == tracy::HandshakeProtocolMismatch )
|
||||||
@ -179,7 +179,6 @@ int main( int argc, char** argv )
|
|||||||
}
|
}
|
||||||
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||||
}
|
}
|
||||||
while( !worker.HasData() ) std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
|
||||||
printf( "\nQueue delay: %s\nTimer resolution: %s\n", tracy::TimeToString( worker.GetDelay() ), tracy::TimeToString( worker.GetResolution() ) );
|
printf( "\nQueue delay: %s\nTimer resolution: %s\n", tracy::TimeToString( worker.GetDelay() ), tracy::TimeToString( worker.GetResolution() ) );
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
Loading…
Reference in New Issue
Block a user