mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Put queries into queue if send buffer is full.
This commit is contained in:
parent
deeea0ee70
commit
9010b2c142
@ -1765,6 +1765,14 @@ void Worker::Exec()
|
||||
if( m_bufferOffset > TargetFrameSize * 2 ) m_bufferOffset = 0;
|
||||
|
||||
HandlePostponedPlots();
|
||||
|
||||
while( !m_serverQueryQueue.empty() && m_serverQuerySpaceLeft > 0 )
|
||||
{
|
||||
m_serverQuerySpaceLeft--;
|
||||
const auto& query = m_serverQueryQueue.back();
|
||||
m_sock.Send( &query, ServerQueryPacketSize );
|
||||
m_serverQueryQueue.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
auto t1 = std::chrono::high_resolution_clock::now();
|
||||
@ -1814,8 +1822,15 @@ close:
|
||||
void Worker::Query( ServerQuery type, uint64_t data )
|
||||
{
|
||||
ServerQueryPacket query = { type, data };
|
||||
m_serverQuerySpaceLeft--;
|
||||
m_sock.Send( &query, ServerQueryPacketSize );
|
||||
if( m_serverQuerySpaceLeft > 0 )
|
||||
{
|
||||
m_serverQuerySpaceLeft--;
|
||||
m_sock.Send( &query, ServerQueryPacketSize );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_serverQueryQueue.insert( m_serverQueryQueue.begin(), query );
|
||||
}
|
||||
}
|
||||
|
||||
bool Worker::DispatchProcess( const QueueItem& ev, char*& ptr )
|
||||
|
Loading…
Reference in New Issue
Block a user