aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/SendCounterPacket.cpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2019-11-29 09:10:59 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-11-29 11:37:17 +0000
commit2ba48d251d0fe4dca214497ac33283106ca0973b (patch)
treed92ca2462e1853ac116dc8dd26c7c3afac4103c6 /src/profiling/SendCounterPacket.cpp
parente011d20f279e6e67e899bc6930b0266fc357bc1c (diff)
downloadarmnn-2ba48d251d0fe4dca214497ac33283106ca0973b.tar.gz
IVGCVSW-4118 Fix long unit test execution
* Reduced sleep_for timings * Removed duplicate SendStreamMetaDataPacket. * Modified SendCounterPacket::WaitForPacketSent to use wait_for * Modified SendCounterPacket::Send WaitingForAck to use wait_for * Added destructor to StreamRedirector. * Added method SendCounterPacketTests::HasWrittenData * Restructured many tests in ProfilingTests. Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I55c59cac6674ac40a1056a5302a997d5da9e9d91 Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
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;