summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp')
-rw-r--r--tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
index 235829b268..041f801672 100644
--- a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
+++ b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
@@ -70,7 +70,7 @@ class SingletonObject: public QObject
Q_OBJECT
public:
static int runCount;
- SingletonObject() { val = 42; ++runCount; }
+ SingletonObject() { val.store(42); ++runCount; }
~SingletonObject() { }
QBasicAtomicInt val;
@@ -126,7 +126,7 @@ void tst_QThreadOnce::sameThread()
QCOMPARE(controlVariable, 1);
static QSingleton<SingletonObject> s;
- QTEST((int)s->val, "expectedValue");
+ QTEST((int)s->val.load(), "expectedValue");
s->val.ref();
QCOMPARE(SingletonObject::runCount, 1);
@@ -148,7 +148,7 @@ void tst_QThreadOnce::multipleThreads()
QCOMPARE(controlVariable, 0); // nothing must have set them yet
SingletonObject::runCount = 0;
- IncrementThread::runCount = 0;
+ IncrementThread::runCount.store(0);
// wait for all of them to be ready
sem2.acquire(NumberOfThreads);
@@ -159,7 +159,7 @@ void tst_QThreadOnce::multipleThreads()
delete parent;
QCOMPARE(controlVariable, 1);
- QCOMPARE((int)IncrementThread::runCount, NumberOfThreads);
+ QCOMPARE((int)IncrementThread::runCount.load(), NumberOfThreads);
QCOMPARE(SingletonObject::runCount, 1);
}