mirror of
https://github.com/wolfpld/tracy.git
synced 2024-12-01 17:34:36 +00:00
Track server connection status.
This commit is contained in:
parent
8f29976237
commit
76aad0d2a4
@ -22,6 +22,7 @@ static View* s_instance = nullptr;
|
|||||||
View::View( const char* addr )
|
View::View( const char* addr )
|
||||||
: m_addr( addr )
|
: m_addr( addr )
|
||||||
, m_shutdown( false )
|
, m_shutdown( false )
|
||||||
|
, m_connected( false )
|
||||||
, m_mbps( 64 )
|
, m_mbps( 64 )
|
||||||
, m_stream( LZ4_createStreamDecode() )
|
, m_stream( LZ4_createStreamDecode() )
|
||||||
, m_buffer( new char[TargetFrameSize*3] )
|
, m_buffer( new char[TargetFrameSize*3] )
|
||||||
@ -74,6 +75,8 @@ void View::Worker()
|
|||||||
m_frames.push_back( timeStart );
|
m_frames.push_back( timeStart );
|
||||||
LZ4_setStreamDecode( m_stream, nullptr, 0 );
|
LZ4_setStreamDecode( m_stream, nullptr, 0 );
|
||||||
|
|
||||||
|
m_connected.store( true, std::memory_order_relaxed );
|
||||||
|
|
||||||
t0 = std::chrono::high_resolution_clock::now();
|
t0 = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
@ -131,6 +134,7 @@ void View::Worker()
|
|||||||
|
|
||||||
close:
|
close:
|
||||||
m_sock.Close();
|
m_sock.Close();
|
||||||
|
m_connected.store( false, std::memory_order_relaxed );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ private:
|
|||||||
Socket m_sock;
|
Socket m_sock;
|
||||||
std::thread m_thread;
|
std::thread m_thread;
|
||||||
std::atomic<bool> m_shutdown;
|
std::atomic<bool> m_shutdown;
|
||||||
|
std::atomic<bool> m_connected;
|
||||||
|
|
||||||
// this block must be locked
|
// this block must be locked
|
||||||
std::mutex m_lock;
|
std::mutex m_lock;
|
||||||
|
Loading…
Reference in New Issue
Block a user