mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +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
|
#ifdef TRACY_HAS_CALLSTACK
|
||||||
SymbolQueueItem si;
|
for(;;)
|
||||||
while( m_symbolQueue.try_dequeue( si ) ) HandleSymbolQueueItem( si );
|
{
|
||||||
|
auto si = m_symbolQueue.front();
|
||||||
|
if( !si ) break;
|
||||||
|
HandleSymbolQueueItem( *si );
|
||||||
|
m_symbolQueue.pop();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1928,8 +1933,13 @@ void Profiler::Worker()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef TRACY_HAS_CALLSTACK
|
#ifdef TRACY_HAS_CALLSTACK
|
||||||
SymbolQueueItem si;
|
for(;;)
|
||||||
while( m_symbolQueue.try_dequeue( si ) ) HandleSymbolQueueItem( si );
|
{
|
||||||
|
auto si = m_symbolQueue.front();
|
||||||
|
if( !si ) break;
|
||||||
|
HandleSymbolQueueItem( *si );
|
||||||
|
m_symbolQueue.pop();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
while( Dequeue( token ) == DequeueStatus::DataDequeued ) {}
|
while( Dequeue( token ) == DequeueStatus::DataDequeued ) {}
|
||||||
while( DequeueSerial() == DequeueStatus::DataDequeued ) {}
|
while( DequeueSerial() == DequeueStatus::DataDequeued ) {}
|
||||||
@ -3171,19 +3181,20 @@ void Profiler::SymbolWorker()
|
|||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
const auto shouldExit = ShouldExit();
|
const auto shouldExit = ShouldExit();
|
||||||
SymbolQueueItem si;
|
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
if( !IsConnected() )
|
if( !IsConnected() )
|
||||||
{
|
{
|
||||||
if( shouldExit ) return;
|
if( shouldExit ) return;
|
||||||
while( m_symbolQueue.pop() ) {}
|
while( m_symbolQueue.front() ) m_symbolQueue.pop();
|
||||||
std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );
|
std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if( m_symbolQueue.try_dequeue( si ) )
|
auto si = m_symbolQueue.front();
|
||||||
|
if( si )
|
||||||
{
|
{
|
||||||
HandleSymbolQueueItem( si );
|
HandleSymbolQueueItem( *si );
|
||||||
|
m_symbolQueue.pop();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "tracy_concurrentqueue.h"
|
#include "tracy_concurrentqueue.h"
|
||||||
#include "tracy_readerwriterqueue.h"
|
#include "tracy_SPSCQueue.h"
|
||||||
#include "TracyCallstack.hpp"
|
#include "TracyCallstack.hpp"
|
||||||
#include "TracySysTime.hpp"
|
#include "TracySysTime.hpp"
|
||||||
#include "TracyFastVector.hpp"
|
#include "TracyFastVector.hpp"
|
||||||
@ -864,7 +864,7 @@ private:
|
|||||||
TracyMutex m_fiLock;
|
TracyMutex m_fiLock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ReaderWriterQueue<SymbolQueueItem> m_symbolQueue;
|
SPSCQueue<SymbolQueueItem> m_symbolQueue;
|
||||||
|
|
||||||
std::atomic<uint64_t> m_frameCount;
|
std::atomic<uint64_t> m_frameCount;
|
||||||
std::atomic<bool> m_isConnected;
|
std::atomic<bool> m_isConnected;
|
||||||
|
Loading…
Reference in New Issue
Block a user