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:
|
case AtomicTestCase::IncAndDecMixed:
|
||||||
wxAtomicInc(m_operateOn);
|
wxAtomicInc(m_operateOn);
|
||||||
wxAtomicDec(m_operateOn);
|
if ( wxAtomicDec(m_operateOn) < 0 )
|
||||||
|
|
||||||
if (m_operateOn < 0)
|
|
||||||
++negativeValuesSeen;
|
++negativeValuesSeen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user