mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Clear queues before new on-demand connection is made.
This commit is contained in:
parent
a767c5ea08
commit
f8b2ffdc7e
@ -294,6 +294,7 @@ void Profiler::Worker()
|
||||
}
|
||||
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
ClearQueues( token );
|
||||
m_isConnected.store( true, std::memory_order_relaxed );
|
||||
#endif
|
||||
|
||||
@ -398,6 +399,17 @@ void Profiler::Worker()
|
||||
}
|
||||
}
|
||||
|
||||
void Profiler::ClearQueues( moodycamel::ConsumerToken& token )
|
||||
{
|
||||
// TODO analyse dropped items and free associated memory
|
||||
|
||||
while( s_queue.try_dequeue_bulk( token, m_itemBuf, BulkSize ) > 0 ) {}
|
||||
|
||||
std::lock_guard<NonRecursiveBenaphore> lock( m_serialLock );
|
||||
m_serialDequeue.clear();
|
||||
m_serialQueue.clear();
|
||||
}
|
||||
|
||||
Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
|
||||
{
|
||||
const auto sz = s_queue.try_dequeue_bulk( token, m_itemBuf, BulkSize );
|
||||
|
@ -300,6 +300,7 @@ private:
|
||||
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
|
||||
void Worker();
|
||||
|
||||
void ClearQueues( moodycamel::ConsumerToken& token );
|
||||
DequeueStatus Dequeue( moodycamel::ConsumerToken& token );
|
||||
DequeueStatus DequeueSerial();
|
||||
bool AppendData( const void* data, size_t len );
|
||||
|
Loading…
Reference in New Issue
Block a user