Fix shutdown hang (resolves #160)

This commit is contained in:
joshuakr 2021-01-05 13:07:49 -08:00
parent 3d37c686cf
commit 315d25a787

View File

@ -706,10 +706,10 @@ static void SetupSampling( int64_t& samplingPeriod )
for( int i=0; i<s_numCpus; i++ ) s_ring[i].Enable();
for(;;)
{
if( !traceActive.load( std::memory_order_relaxed ) ) break;
bool hadData = false;
for( int i=0; i<s_numCpus; i++ )
{
if( !traceActive.load( std::memory_order_relaxed ) ) break;
if( !s_ring[i].HasData() ) continue;
hadData = true;