Expose m_isConnected in non-on-demand builds.

This commit is contained in:
Bartosz Taudul 2020-07-16 11:22:06 +02:00
parent d614dbeda3
commit b8df7a1302
2 changed files with 5 additions and 5 deletions

View File

@ -1057,8 +1057,8 @@ Profiler::Profiler()
, m_fiQueue( 16 ) , m_fiQueue( 16 )
, m_fiDequeue( 16 ) , m_fiDequeue( 16 )
, m_frameCount( 0 ) , m_frameCount( 0 )
#ifdef TRACY_ON_DEMAND
, m_isConnected( false ) , m_isConnected( false )
#ifdef TRACY_ON_DEMAND
, m_connectionId( 0 ) , m_connectionId( 0 )
, m_deferredQueue( 64*1024 ) , m_deferredQueue( 64*1024 )
#endif #endif
@ -1391,8 +1391,8 @@ void Profiler::Worker()
const auto currentTime = GetTime(); const auto currentTime = GetTime();
ClearQueues( token ); ClearQueues( token );
m_connectionId.fetch_add( 1, std::memory_order_release ); m_connectionId.fetch_add( 1, std::memory_order_release );
m_isConnected.store( true, std::memory_order_release );
#endif #endif
m_isConnected.store( true, std::memory_order_release );
HandshakeStatus handshake = HandshakeWelcome; HandshakeStatus handshake = HandshakeWelcome;
m_sock->Send( &handshake, sizeof( handshake ) ); m_sock->Send( &handshake, sizeof( handshake ) );
@ -1482,8 +1482,8 @@ void Profiler::Worker()
} }
if( ShouldExit() ) break; if( ShouldExit() ) break;
#ifdef TRACY_ON_DEMAND
m_isConnected.store( false, std::memory_order_release ); m_isConnected.store( false, std::memory_order_release );
#ifdef TRACY_ON_DEMAND
m_bufferOffset = 0; m_bufferOffset = 0;
m_bufferStart = 0; m_bufferStart = 0;
#endif #endif

View File

@ -451,12 +451,12 @@ public:
static bool ShouldExit(); static bool ShouldExit();
#ifdef TRACY_ON_DEMAND
tracy_force_inline bool IsConnected() const tracy_force_inline bool IsConnected() const
{ {
return m_isConnected.load( std::memory_order_acquire ); return m_isConnected.load( std::memory_order_acquire );
} }
#ifdef TRACY_ON_DEMAND
tracy_force_inline uint64_t ConnectionId() const tracy_force_inline uint64_t ConnectionId() const
{ {
return m_connectionId.load( std::memory_order_acquire ); return m_connectionId.load( std::memory_order_acquire );
@ -667,8 +667,8 @@ private:
TracyMutex m_fiLock; TracyMutex m_fiLock;
std::atomic<uint64_t> m_frameCount; std::atomic<uint64_t> m_frameCount;
#ifdef TRACY_ON_DEMAND
std::atomic<bool> m_isConnected; std::atomic<bool> m_isConnected;
#ifdef TRACY_ON_DEMAND
std::atomic<uint64_t> m_connectionId; std::atomic<uint64_t> m_connectionId;
TracyMutex m_deferredLock; TracyMutex m_deferredLock;