mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Adapt to SPSCQueue interface.
This commit is contained in:
parent
93f83fc50c
commit
a203eb5aef
@ -1901,8 +1901,13 @@ void Profiler::Worker()
|
||||
}
|
||||
|
||||
#ifdef TRACY_HAS_CALLSTACK
|
||||
SymbolQueueItem si;
|
||||
while( m_symbolQueue.try_dequeue( si ) ) HandleSymbolQueueItem( si );
|
||||
for(;;)
|
||||
{
|
||||
auto si = m_symbolQueue.front();
|
||||
if( !si ) break;
|
||||
HandleSymbolQueueItem( *si );
|
||||
m_symbolQueue.pop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1928,8 +1933,13 @@ void Profiler::Worker()
|
||||
}
|
||||
}
|
||||
#ifdef TRACY_HAS_CALLSTACK
|
||||
SymbolQueueItem si;
|
||||
while( m_symbolQueue.try_dequeue( si ) ) HandleSymbolQueueItem( si );
|
||||
for(;;)
|
||||
{
|
||||
auto si = m_symbolQueue.front();
|
||||
if( !si ) break;
|
||||
HandleSymbolQueueItem( *si );
|
||||
m_symbolQueue.pop();
|
||||
}
|
||||
#endif
|
||||
while( Dequeue( token ) == DequeueStatus::DataDequeued ) {}
|
||||
while( DequeueSerial() == DequeueStatus::DataDequeued ) {}
|
||||
@ -3171,19 +3181,20 @@ void Profiler::SymbolWorker()
|
||||
for(;;)
|
||||
{
|
||||
const auto shouldExit = ShouldExit();
|
||||
SymbolQueueItem si;
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
if( !IsConnected() )
|
||||
{
|
||||
if( shouldExit ) return;
|
||||
while( m_symbolQueue.pop() ) {}
|
||||
while( m_symbolQueue.front() ) m_symbolQueue.pop();
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if( m_symbolQueue.try_dequeue( si ) )
|
||||
auto si = m_symbolQueue.front();
|
||||
if( si )
|
||||
{
|
||||
HandleSymbolQueueItem( si );
|
||||
HandleSymbolQueueItem( *si );
|
||||
m_symbolQueue.pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "tracy_concurrentqueue.h"
|
||||
#include "tracy_readerwriterqueue.h"
|
||||
#include "tracy_SPSCQueue.h"
|
||||
#include "TracyCallstack.hpp"
|
||||
#include "TracySysTime.hpp"
|
||||
#include "TracyFastVector.hpp"
|
||||
@ -864,7 +864,7 @@ private:
|
||||
TracyMutex m_fiLock;
|
||||
#endif
|
||||
|
||||
ReaderWriterQueue<SymbolQueueItem> m_symbolQueue;
|
||||
SPSCQueue<SymbolQueueItem> m_symbolQueue;
|
||||
|
||||
std::atomic<uint64_t> m_frameCount;
|
||||
std::atomic<bool> m_isConnected;
|
||||
|
Loading…
x
Reference in New Issue
Block a user