aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/CommandHandler.cpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-10-07 12:35:21 +0100
committerJim Flynn Arm <jim.flynn@arm.com>2019-10-08 08:22:51 +0000
commitc2728f95086c54aa842e4c1dae8f3b5c290a72fa (patch)
tree82002c3d0c97abfeed905d0e922579dab09b2c31 /src/profiling/CommandHandler.cpp
parente61ffd00a37f02338129e92d65be2f01600014c0 (diff)
downloadarmnn-c2728f95086c54aa842e4c1dae8f3b5c290a72fa.tar.gz
IVGCVSW-3937 Refactor and improve the CommandHandleRegistry class
* Added simplified RegisterFunctor method * Code refactoring * Updated the unit tests accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: Iee941d898facd9c1ab5366e87c611c99a0468830
Diffstat (limited to 'src/profiling/CommandHandler.cpp')
-rw-r--r--src/profiling/CommandHandler.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/profiling/CommandHandler.cpp b/src/profiling/CommandHandler.cpp
index 5eddfd5ec3..49784056bf 100644
--- a/src/profiling/CommandHandler.cpp
+++ b/src/profiling/CommandHandler.cpp
@@ -18,14 +18,14 @@ void CommandHandler::Start(IProfilingConnection& profilingConnection)
return;
}
- m_IsRunning.store(true, std::memory_order_relaxed);
- m_KeepRunning.store(true, std::memory_order_relaxed);
+ m_IsRunning.store(true);
+ m_KeepRunning.store(true);
m_CommandThread = std::thread(&CommandHandler::HandleCommands, this, std::ref(profilingConnection));
}
void CommandHandler::Stop()
{
- m_KeepRunning.store(false, std::memory_order_relaxed);
+ m_KeepRunning.store(false);
if (m_CommandThread.joinable())
{
@@ -33,21 +33,6 @@ void CommandHandler::Stop()
}
}
-bool CommandHandler::IsRunning() const
-{
- return m_IsRunning.load(std::memory_order_relaxed);
-}
-
-void CommandHandler::SetTimeout(uint32_t timeout)
-{
- m_Timeout.store(timeout, std::memory_order_relaxed);
-}
-
-void CommandHandler::SetStopAfterTimeout(bool stopAfterTimeout)
-{
- m_StopAfterTimeout.store(stopAfterTimeout, std::memory_order_relaxed);
-}
-
void CommandHandler::HandleCommands(IProfilingConnection& profilingConnection)
{
do
@@ -72,12 +57,12 @@ void CommandHandler::HandleCommands(IProfilingConnection& profilingConnection)
catch (...)
{
// Might want to differentiate the errors more
- m_KeepRunning.store(false, std::memory_order_relaxed);
+ m_KeepRunning.store(false);
}
}
- while (m_KeepRunning.load(std::memory_order_relaxed));
+ while (m_KeepRunning.load());
- m_IsRunning.store(false, std::memory_order_relaxed);
+ m_IsRunning.store(false);
}
} // namespace profiling