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.
This commit is contained in:
Vadim Zeitlin
2022-05-10 23:55:25 +02:00
parent 44131b044d
commit a2e68f43ea

View File

@@ -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;