mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Don't exit until all data is sent.
This commit is contained in:
parent
652dccd163
commit
d942b7edf1
@ -192,8 +192,6 @@ void Profiler::Worker()
|
|||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
if( ShouldExit() ) return;
|
|
||||||
|
|
||||||
QueueItem item[BulkSize];
|
QueueItem item[BulkSize];
|
||||||
const auto sz = s_queue.try_dequeue_bulk( token, item, BulkSize );
|
const auto sz = s_queue.try_dequeue_bulk( token, item, BulkSize );
|
||||||
if( sz > 0 )
|
if( sz > 0 )
|
||||||
@ -212,6 +210,7 @@ void Profiler::Worker()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if( ShouldExit() ) return;
|
||||||
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,6 +276,8 @@ void Profiler::SendSourceLocation( uint64_t ptr )
|
|||||||
s_token.ptr->enqueue<moodycamel::CanAlloc>( std::move( item ) );
|
s_token.ptr->enqueue<moodycamel::CanAlloc>( std::move( item ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool DontExit() { return false; }
|
||||||
|
|
||||||
bool Profiler::HandleServerQuery()
|
bool Profiler::HandleServerQuery()
|
||||||
{
|
{
|
||||||
timeval tv;
|
timeval tv;
|
||||||
@ -284,10 +285,10 @@ bool Profiler::HandleServerQuery()
|
|||||||
tv.tv_usec = 10000;
|
tv.tv_usec = 10000;
|
||||||
|
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
if( !m_sock->Read( &type, sizeof( type ), &tv, ShouldExit ) ) return false;
|
if( !m_sock->Read( &type, sizeof( type ), &tv, DontExit ) ) return false;
|
||||||
|
|
||||||
uint64_t ptr;
|
uint64_t ptr;
|
||||||
if( !m_sock->Read( &ptr, sizeof( ptr ), &tv, ShouldExit ) ) return false;
|
if( !m_sock->Read( &ptr, sizeof( ptr ), &tv, DontExit ) ) return false;
|
||||||
|
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user