diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2019-09-05 16:29:01 +0100 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2019-09-05 16:29:01 +0100 |
commit | 0696569fbfb76b485624de24462aaf10d84f415d (patch) | |
tree | 88d400489e50f652cbbba4af286c0211247ecbe3 | |
parent | 868eb14c463ee76668ad75d4cd4e718a840f7be6 (diff) | |
download | armnn-0696569fbfb76b485624de24462aaf10d84f415d.tar.gz |
IVGCVSW-3432 Create CaptureData Holder
* Fix race condition where result was read before execution of write
Change-Id: I8961c4ce5a9000cb4d465106fe56e615beecf4dc
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
-rw-r--r-- | src/profiling/test/ProfilingTests.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index c7b0bda0ff..58609528e4 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -403,10 +403,11 @@ BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) BOOST_CHECK(captureData.GetCounterIds() == counterIds3); std::thread thread3(CaptureDataWriteThreadImpl, std::ref(holder), capturePeriod2, std::ref(counterIds1)); - std::thread thread4(CaptureDataReadThreadImpl, std::ref(holder), std::ref(captureData)); - std::thread thread5(CaptureDataWriteThreadImpl, std::ref(holder), capturePeriod1, std::ref(counterIds2)); + std::thread thread4(CaptureDataWriteThreadImpl, std::ref(holder), capturePeriod1, std::ref(counterIds2)); thread3.join(); thread4.join(); + + std::thread thread5(CaptureDataReadThreadImpl, std::ref(holder), std::ref(captureData)); thread5.join(); // Check CaptureData was written/read correctly from multiple threads |