From a2e68f43eac1c508f44e46bab057f26e4449a5e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 May 2022 23:55:25 +0200 Subject: [PATCH] Avoid direct access to an atomic variable in the test This (correctly) results in a warning about data race from TSAN, so don't do it and use the return value of wxAtomicDec() instead. --- tests/thread/atomic.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/thread/atomic.cpp b/tests/thread/atomic.cpp index 0ec7362f3d..1e554935bf 100644 --- a/tests/thread/atomic.cpp +++ b/tests/thread/atomic.cpp @@ -171,9 +171,7 @@ void *AtomicTestCase::MyThread::Entry() { case AtomicTestCase::IncAndDecMixed: wxAtomicInc(m_operateOn); - wxAtomicDec(m_operateOn); - - if (m_operateOn < 0) + if ( wxAtomicDec(m_operateOn) < 0 ) ++negativeValuesSeen; break;