Always use ShouldExit() to determine if worker should exit.

This commit is contained in:
Bartosz Taudul 2017-10-16 21:21:42 +02:00
parent 9f28205548
commit e04bd05606

View File

@ -132,7 +132,7 @@ void Profiler::Worker()
{ {
for(;;) for(;;)
{ {
if( m_shutdown.load( std::memory_order_relaxed ) ) return; if( ShouldExit() ) return;
m_sock = listen.Accept(); m_sock = listen.Accept();
if( m_sock ) break; if( m_sock ) break;
} }
@ -163,7 +163,7 @@ void Profiler::Worker()
for(;;) for(;;)
{ {
if( m_shutdown.load( std::memory_order_relaxed ) ) return; 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 );