aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/SendCounterPacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/SendCounterPacket.cpp')
-rw-r--r--src/profiling/SendCounterPacket.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp
index 1ed926b6d7..2d6458316f 100644
--- a/src/profiling/SendCounterPacket.cpp
+++ b/src/profiling/SendCounterPacket.cpp
@@ -1012,10 +1012,10 @@ void SendCounterPacket::Send(IProfilingConnection& profilingConnection)
// Flush the buffer manually to send the packet
FlushBuffer(profilingConnection);
- // Wait indefinitely until notified otherwise (it could that the profiling state has changed due to the
- // connection being acknowledged, or that new data is ready to be sent, or that the send thread is
- // being shut down, etc.)
- m_WaitCondition.wait(lock);
+ // Wait for a connection ack from the remote server. We should expect a response within timeout value.
+ // If not, drop back to the start of the loop and detect somebody closing the thread. Then send the
+ // StreamMetadata again.
+ m_WaitCondition.wait_for(lock, std::chrono::milliseconds(m_Timeout));
// Do not flush the buffer again
continue;