summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-09-29 11:52:33 +0200
committerQt by Nokia <qt-info@nokia.com>2011-12-02 13:21:32 +0100
commit409b3b42a233ca58c075a75f35be5ba9b351c7de (patch)
treee88cdf48672600a4400e1566ea4405ffc38470b0 /tests/auto/corelib/tools
parent3a72240d86dc85f1f2e7d47752953d83c43369c5 (diff)
Remove cast and assignment operators from QAtomicInt and QAtomicPointer
This is a source incompatible change. There is concern that the convenience of the implicit cast and assignment operators can lead to misuse. Several commits have already been done that remove excess use of the implicit cast, which is a *volatile* read every time it's used. Users of the QAtomic* API should have to think about when they are loading the value, and if they do or don't need the acquire memory barrier on load. The code that people would write using this API is meant to be multi-threaded, concurrent, and correct. The API should not allow them to inadvertently, possibly unknowingly, shoot themselves in the foot. SC-break-rubber-stamped-by: Lars Knoll Change-Id: I88fbc26d9db7b5ec80a58ad6271ffa13bbfd191f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 416ce147be..e62ee0f051 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -1545,8 +1545,8 @@ void tst_QSharedPointer::threadStressTest()
// verify that the count is the right range
int minValue = strongThreadCount;
int maxValue = strongThreadCount + weakThreadCount;
- QVERIFY(counter >= minValue);
- QVERIFY(counter <= maxValue);
+ QVERIFY(counter.load() >= minValue);
+ QVERIFY(counter.load() <= maxValue);
}
}