MCPcopy Create free account
hub / github.com/ARM-software/armnn / Start

Method Start

profiling/client/src/SendThread.cpp:54–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void SendThread::Start(IProfilingConnection& profilingConnection)
55{
56 // Check if the send thread is already running
57 if (m_IsRunning.load())
58 {
59 // The send thread is already running
60 return;
61 }
62
63#if !defined(ARMNN_DISABLE_THREADS)
64 if (m_SendThread.joinable())
65 {
66 m_SendThread.join();
67 }
68#endif
69
70 // Mark the send thread as running
71 m_IsRunning.store(true);
72
73 // Keep the send procedure going until the send thread is signalled to stop
74 m_KeepRunning.store(true);
75
76 // Make sure the send thread will not flush the buffer until signaled to do so
77 // no need for a mutex as the send thread can not be running at this point
78 m_ReadyToRead = false;
79
80 m_PacketSent = false;
81
82 // Start the send thread
83#if !defined(ARMNN_DISABLE_THREADS)
84 m_SendThread = std::thread(&SendThread::Send, this, std::ref(profilingConnection));
85#else
86 IgnoreUnused(profilingConnection);
87#endif
88}
89
90void SendThread::Stop(bool rethrowSendThreadExceptions)
91{

Callers 2

UpdateMethod · 0.45
operator()Method · 0.45

Calls 3

loadMethod · 0.80
storeMethod · 0.80
IgnoreUnusedFunction · 0.50

Tested by

no test coverage detected