Make sure symbols thread has time to enter into disconnected condition.

This commit is contained in:
Bartosz Taudul
2025-10-21 20:42:44 +02:00
parent 22dc5b1ca7
commit 30267de474
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -1492,6 +1492,7 @@ Profiler::Profiler()
, m_isConnected( false )
#ifdef TRACY_ON_DEMAND
, m_connectionId( 0 )
, m_symbolsBusy( false )
, m_deferredQueue( 64*1024 )
#endif
, m_paramCallback( nullptr )
@@ -1977,6 +1978,8 @@ void Profiler::Worker()
}
#ifdef TRACY_ON_DEMAND
while( m_symbolsBusy.load( std::memory_order_acquire ) ) { YieldThread(); }
m_symbolsBusy.store( true, std::memory_order_release );
const auto currentTime = GetTime();
ClearQueues( token );
m_connectionId.fetch_add( 1, std::memory_order_release );
@@ -3623,6 +3626,7 @@ void Profiler::SymbolWorker()
}
while( m_symbolQueue.front() ) m_symbolQueue.pop();
std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );
m_symbolsBusy.store( false, std::memory_order_release );
continue;
}
#endif
+1
View File
@@ -1043,6 +1043,7 @@ private:
std::atomic<bool> m_isConnected;
#ifdef TRACY_ON_DEMAND
std::atomic<uint64_t> m_connectionId;
std::atomic<bool> m_symbolsBusy;
TracyMutex m_deferredLock;
FastVector<QueueItem> m_deferredQueue;