diff options
Diffstat (limited to 'tests/auto/corelib/thread')
-rw-r--r-- | tests/auto/corelib/thread/qmutex/tst_qmutex.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp index cc36af8b56..82b0c98522 100644 --- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp @@ -576,28 +576,28 @@ public: quint64 i = 0; while (t.elapsed() < one_minute) { i++; - uint nb = (i * 9 + lockCount * 13) % threadCount; + uint nb = (i * 9 + lockCount.load() * 13) % threadCount; QMutexLocker locker(&mutex[nb]); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); if (sentinel[nb].fetchAndAddRelaxed(5)) errorCount.ref(); if (!sentinel[nb].testAndSetRelaxed(5, 0)) errorCount.ref(); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); lockCount.ref(); - nb = (nb * 17 + i * 5 + lockCount * 3) % threadCount; + nb = (nb * 17 + i * 5 + lockCount.load() * 3) % threadCount; if (mutex[nb].tryLock()) { - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); if (sentinel[nb].fetchAndAddRelaxed(16)) errorCount.ref(); if (!sentinel[nb].testAndSetRelaxed(16, 0)) errorCount.ref(); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); lockCount.ref(); mutex[nb].unlock(); } - nb = (nb * 15 + i * 47 + lockCount * 31) % threadCount; + nb = (nb * 15 + i * 47 + lockCount.load() * 31) % threadCount; if (mutex[nb].tryLock(2)) { - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); if (sentinel[nb].fetchAndAddRelaxed(53)) errorCount.ref(); if (!sentinel[nb].testAndSetRelaxed(53, 0)) errorCount.ref(); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); lockCount.ref(); mutex[nb].unlock(); } |