diff options
Diffstat (limited to 'src/profiling/SendCounterPacket.hpp')
-rw-r--r-- | src/profiling/SendCounterPacket.hpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/profiling/SendCounterPacket.hpp b/src/profiling/SendCounterPacket.hpp index 102cbccc84..42e84323e4 100644 --- a/src/profiling/SendCounterPacket.hpp +++ b/src/profiling/SendCounterPacket.hpp @@ -64,12 +64,11 @@ public: void Stop(bool rethrowSendThreadExceptions = true); bool IsRunning() { return m_IsRunning.load(); } - void WaitForPacketSent() + void WaitForPacketSent(uint32_t timeout = 1000) { std::unique_lock<std::mutex> lock(m_PacketSentWaitMutex); - - // Blocks until notified that at least a packet has been sent - m_PacketSentWaitCondition.wait(lock); + // Blocks until notified that at least a packet has been sent or until timeout expires. + m_PacketSentWaitCondition.wait_for(lock, std::chrono::milliseconds(timeout)); } private: |