More strict memory ordering for on-demand connection status.

This commit is contained in:
Bartosz Taudul 2019-06-09 16:48:00 +02:00
parent e2d42fae2f
commit cc5bad294a
2 changed files with 3 additions and 3 deletions

View File

@ -1162,7 +1162,7 @@ void Profiler::Worker()
#ifdef TRACY_ON_DEMAND
ClearQueues( token );
m_isConnected.store( true, std::memory_order_relaxed );
m_isConnected.store( true, std::memory_order_release );
#endif
HandshakeStatus handshake = HandshakeWelcome;
@ -1232,7 +1232,7 @@ void Profiler::Worker()
if( ShouldExit() ) break;
#ifdef TRACY_ON_DEMAND
m_isConnected.store( false, std::memory_order_relaxed );
m_isConnected.store( false, std::memory_order_release );
#endif
m_sock->~Socket();

View File

@ -407,7 +407,7 @@ public:
#ifdef TRACY_ON_DEMAND
tracy_force_inline bool IsConnected()
{
return m_isConnected.load( std::memory_order_relaxed );
return m_isConnected.load( std::memory_order_acquire );
}
tracy_force_inline void DeferItem( const QueueItem& item )