mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54: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 )
|
||||
: m_addr( addr )
|
||||
, m_shutdown( false )
|
||||
, m_connected( false )
|
||||
, m_mbps( 64 )
|
||||
, m_stream( LZ4_createStreamDecode() )
|
||||
, m_buffer( new char[TargetFrameSize*3] )
|
||||
@ -74,6 +75,8 @@ void View::Worker()
|
||||
m_frames.push_back( timeStart );
|
||||
LZ4_setStreamDecode( m_stream, nullptr, 0 );
|
||||
|
||||
m_connected.store( true, std::memory_order_relaxed );
|
||||
|
||||
t0 = std::chrono::high_resolution_clock::now();
|
||||
|
||||
for(;;)
|
||||
@ -131,6 +134,7 @@ void View::Worker()
|
||||
|
||||
close:
|
||||
m_sock.Close();
|
||||
m_connected.store( false, std::memory_order_relaxed );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,7 @@ private:
|
||||
Socket m_sock;
|
||||
std::thread m_thread;
|
||||
std::atomic<bool> m_shutdown;
|
||||
std::atomic<bool> m_connected;
|
||||
|
||||
// this block must be locked
|
||||
std::mutex m_lock;
|
||||
|
Loading…
Reference in New Issue
Block a user