summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qthreadstorage
diff options
context:
space:
mode:
authorThiago Macieira <thiago@kde.org>2011-07-05 23:46:19 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-03 07:57:41 +0200
commit5bfeab8749ce6820d55135b81665a7231d3b1504 (patch)
tree152569571114c53d4cdfaa0013307267cb3379a6 /tests/auto/corelib/thread/qthreadstorage
parent5613c9722adee921e16682c0a035f2a7567bd346 (diff)
Make all uses of QBasicAtomicInt and Pointer use load() and store()
Most of these changes are search-and-replace of d->ref ==, d->ref != and d->ref =. The QBasicAtomicPointer in QObjectPrivate::Connection didn't need to be basic, so I made it QAtomicPointer. Change-Id: Ie3271abd1728af599f9ab17c6f4868e475f17bb6 Reviewed-on: http://codereview.qt-project.org/5030 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/corelib/thread/qthreadstorage')
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index e123fc4fea..4fc3981abf 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -358,7 +358,7 @@ void tst_QThreadStorage::QTBUG14579_leakInDestructor()
QVERIFY(tls.hasLocalData());
}
};
- int c = SPointer::count;
+ int c = SPointer::count.load();
QThreadStorage<QTBUG14579_class *> tls;
@@ -382,7 +382,7 @@ void tst_QThreadStorage::QTBUG14579_leakInDestructor()
QVERIFY(t3.wait());
//check all the constructed things have been destructed
- QCOMPARE(int(SPointer::count), c);
+ QCOMPARE(int(SPointer::count.load()), c);
}
class QTBUG14579_reset {
@@ -410,7 +410,7 @@ void tst_QThreadStorage::QTBUG14579_resetInDestructor()
QVERIFY(QTBUG14579_resetTls()->hasLocalData());
}
};
- int c = SPointer::count;
+ int c = SPointer::count.load();
Thread t1;
Thread t2;
@@ -423,7 +423,7 @@ void tst_QThreadStorage::QTBUG14579_resetInDestructor()
QVERIFY(t3.wait());
//check all the constructed things have been destructed
- QCOMPARE(int(SPointer::count), c);
+ QCOMPARE(int(SPointer::count.load()), c);
}
@@ -474,7 +474,7 @@ void tst_QThreadStorage::valueBased()
QThreadStorage<QString> tlsString;
QThreadStorage<int> tlsInt;
- int c = SPointer::count;
+ int c = SPointer::count.load();
Thread t1(tlsSPointer, tlsString, tlsInt);
Thread t2(tlsSPointer, tlsString, tlsInt);
@@ -494,7 +494,7 @@ void tst_QThreadStorage::valueBased()
QVERIFY(t2.wait());
QVERIFY(t3.wait());
- QCOMPARE(c, int(SPointer::count));
+ QCOMPARE(c, int(SPointer::count.load()));
}