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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user