From 5bfeab8749ce6820d55135b81665a7231d3b1504 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 5 Jul 2011 23:46:19 +0200 Subject: 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 Reviewed-by: Bradley T. Hughes Reviewed-by: Lars Knoll --- src/corelib/tools/qsharedpointer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qsharedpointer.cpp') diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 873a2bf0d9..e9ae3cb4da 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -1260,13 +1260,13 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge // we can create the refcount data because it doesn't exist ExternalRefCountData *x = new ExternalRefCountData(Qt::Uninitialized); - x->strongref = -1; - x->weakref = 2; // the QWeakPointer that called us plus the QObject itself + x->strongref.store(-1); + x->weakref.store(2); // the QWeakPointer that called us plus the QObject itself if (!d->sharedRefcount.testAndSetRelease(0, x)) { delete x; d->sharedRefcount->weakref.ref(); } - return d->sharedRefcount; + return d->sharedRefcount.loadAcquire(); } QT_END_NAMESPACE -- cgit v1.2.3