From 79eb1b90293f22e93135c0b621de65e1a549af29 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 27 Jun 2019 13:37:09 +0200 Subject: [PATCH] Swap queue and dequeue only if queue has contents. --- client/TracyProfiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index bdd1ccee..692bdcc0 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1414,7 +1414,7 @@ void Profiler::CompressWorker() break; } } - m_fiQueue.swap( m_fiDequeue ); + if( !m_fiQueue.empty() ) m_fiQueue.swap( m_fiDequeue ); if( lockHeld ) { m_fiLock.unlock(); @@ -1626,7 +1626,7 @@ Profiler::DequeueStatus Profiler::DequeueSerial() break; } } - m_serialQueue.swap( m_serialDequeue ); + if( !m_serialQueue.empty() ) m_serialQueue.swap( m_serialDequeue ); if( lockHeld ) { m_serialLock.unlock();