mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Add connection id for on-demand mode.
Long-lived zones could send their end events without begin events in a following scenario: 1. On-demand connection is made. 2. Zone begin is emitted, m_active is set to true. 3. Connection is terminated. 4. A new connection is made. 5. Zone end is emitted, because m_active is true. To this point it was assumed that all zone end events will happen before a new connection is made, but it's not necessarily true.
This commit is contained in:
@@ -964,6 +964,7 @@ Profiler::Profiler()
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
, m_isConnected( false )
|
||||
, m_frameCount( 0 )
|
||||
, m_connectionId( 0 )
|
||||
, m_deferredQueue( 64*1024 )
|
||||
#endif
|
||||
{
|
||||
@@ -1162,6 +1163,7 @@ void Profiler::Worker()
|
||||
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
ClearQueues( token );
|
||||
m_connectionId.fetch_add( 1, std::memory_order_release );
|
||||
m_isConnected.store( true, std::memory_order_release );
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user