diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-11-17 15:52:53 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-21 09:58:23 +0100 |
commit | e8b4c49efddb87f4195c74668b5026119eccea56 (patch) | |
tree | 973f4539844b7ff0797bf7b7b1383c853dffda99 /tests/auto/corelib/thread | |
parent | ed5583048ecf3d340ded7e4d5f1b926a9929eebd (diff) |
qtbase tests: Fix some warnings
- Fix warnings about QAtomicPointer/Int usage
- Fix some gcc 4.6 warnings about assigned/unused variables
Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
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(); } |