summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index 7fbb5e9f5f..1ee628dde5 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -1221,9 +1221,9 @@ QT_END_NAMESPACE
class DummyEventDispatcher : public QAbstractEventDispatcher {
public:
- DummyEventDispatcher() : QAbstractEventDispatcher(), visited(false) {}
+ DummyEventDispatcher() : QAbstractEventDispatcher() {}
bool processEvents(QEventLoop::ProcessEventsFlags) {
- visited = true;
+ visited.store(true);
emit awake();
QCoreApplication::sendPostedEvents();
return false;
@@ -1247,7 +1247,7 @@ public:
void unregisterEventNotifier(QWinEventNotifier *) { }
#endif
- bool visited;
+ QBasicAtomicInt visited; // bool
};
class ThreadObj : public QObject
@@ -1285,7 +1285,7 @@ void tst_QThread::customEventDispatcher()
QMetaObject::invokeMethod(&obj, "visit", Qt::QueuedConnection);
loop.exec();
// test that the ED has really been used
- QVERIFY(ed->visited);
+ QVERIFY(ed->visited.load());
QPointer<DummyEventDispatcher> weak_ed(ed);
QVERIFY(!weak_ed.isNull());