diff options
author | Jim Flynn <jim.flynn@arm.com> | 2022-03-23 23:01:26 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2022-03-23 23:43:35 +0000 |
commit | 3e9bc19ad523361e6b18057849e30c0c48183915 (patch) | |
tree | b7b012a9734ce39d054fc5d92302780fd838e5c8 /src/profiling/SendThread.hpp | |
parent | 277618302d0f131eac0b6ac2015dd3eb09aa6ff9 (diff) | |
download | armnn-3e9bc19ad523361e6b18057849e30c0c48183915.tar.gz |
IVGCVSW-6706 Create the libpipeClient library
Change-Id: I2368aade38ad3808fab55d8a86cd659d4e95d91e
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/SendThread.hpp')
-rw-r--r-- | src/profiling/SendThread.hpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/profiling/SendThread.hpp b/src/profiling/SendThread.hpp deleted file mode 100644 index b96a6d54f3..0000000000 --- a/src/profiling/SendThread.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright © 2020 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#pragma once - -#include "IBufferManager.hpp" -#include "IConsumer.hpp" -#include "ISendThread.hpp" -#include "IProfilingConnection.hpp" -#include "ProfilingStateMachine.hpp" -#include "ProfilingUtils.hpp" - -#include <client/include/ISendCounterPacket.hpp> - -#include <common/include/ICounterDirectory.hpp> - -#include <atomic> -#include <condition_variable> -#include <mutex> -#include <thread> -#include <type_traits> - -namespace arm -{ - -namespace pipe -{ - -class SendThread : public ISendThread, public IConsumer -{ -public: - SendThread(ProfilingStateMachine& profilingStateMachine, - IBufferManager& buffer, ISendCounterPacket& sendCounterPacket, int timeout= 1000); - ~SendThread() - { - // Don't rethrow when destructing the object - Stop(false); - } - void Start(IProfilingConnection& profilingConnection) override; - - void Stop(bool rethrowSendThreadExceptions = true) override; - - void SetReadyToRead() override; - - bool IsRunning() { return m_IsRunning.load(); } - - bool WaitForPacketSent(uint32_t timeout); - -private: - void Send(IProfilingConnection& profilingConnection); - - void FlushBuffer(IProfilingConnection& profilingConnection, bool notifyWatchers = true); - - ProfilingStateMachine& m_StateMachine; - IBufferManager& m_BufferManager; - ISendCounterPacket& m_SendCounterPacket; - int m_Timeout; - std::mutex m_WaitMutex; - std::condition_variable m_WaitCondition; - std::thread m_SendThread; - std::atomic<bool> m_IsRunning; - std::atomic<bool> m_KeepRunning; - // m_ReadyToRead will be protected by m_WaitMutex - bool m_ReadyToRead; - // m_PacketSent will be protected by m_PacketSentWaitMutex - bool m_PacketSent; - std::exception_ptr m_SendThreadException; - std::mutex m_PacketSentWaitMutex; - std::condition_variable m_PacketSentWaitCondition; - -}; - -} // namespace pipe - -} // namespace arm |