1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Fix shutdown with TRACY_NO_EXIT=1 on Android. (#134)

This commit is contained in:
bjacob
2020-11-26 14:33:54 -05:00
committed by GitHub
parent 0073fd739f
commit dfdf70aea3
4 changed files with 106 additions and 67 deletions
+3 -1
View File
@@ -784,6 +784,7 @@ static void SetupSampling( int64_t& samplingPeriod )
}
s_ring[i].Advance( hdr.size );
}
if( !traceActive.load( std::memory_order_relaxed) ) break;
if( !hadData )
{
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
@@ -1173,7 +1174,7 @@ void SysTraceWorker( void* ptr )
{
// child
close( pipefd[0] );
dup2( pipefd[1], STDERR_FILENO );
dup2( open( "/dev/null", O_WRONLY ), STDERR_FILENO );
if( dup2( pipefd[1], STDOUT_FILENO ) >= 0 )
{
close( pipefd[1] );
@@ -1194,6 +1195,7 @@ void SysTraceWorker( void* ptr )
pthread_setschedparam( pthread_self(), SCHED_FIFO, &sp );
ProcessTraceLines( pipefd[0] );
close( pipefd[0] );
waitpid( pid, nullptr, 0 );
}
}
}