IVGCVSW-3984 Fix CheckPeriodicCounterCaptureThread
* PerodicCounterCapture now sleeps instead of terminating
when reading empty counter data
* m_IsRunning is now set to false after the thread is joined and
is no longer atomic
* removed usages of find() (not thread safe)
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: Ie65d5a9a7e42a31653ec8eed064849355661ef56
diff --git a/src/profiling/PeriodicCounterCapture.hpp b/src/profiling/PeriodicCounterCapture.hpp
index 2e9ac36..4a28711 100644
--- a/src/profiling/PeriodicCounterCapture.hpp
+++ b/src/profiling/PeriodicCounterCapture.hpp
@@ -38,14 +38,14 @@
void Start() override;
void Stop() override;
- bool IsRunning() const { return m_IsRunning.load(); }
+ bool IsRunning() const { return m_IsRunning; }
private:
CaptureData ReadCaptureData();
void Capture(const IReadCounterValues& readCounterValues);
const Holder& m_CaptureDataHolder;
- std::atomic<bool> m_IsRunning;
+ bool m_IsRunning;
std::atomic<bool> m_KeepRunning;
std::thread m_PeriodCaptureThread;
const IReadCounterValues& m_ReadCounterValues;