diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-10-10 14:41:37 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-10 16:54:52 +0200 |
commit | 78470cd6210601ccab14abdb826481a91a49f199 (patch) | |
tree | 75926adf885181432c723da892e108a7ae4932af /src/corelib/thread/qmutex.cpp | |
parent | ac03f59ccc0c0d654b107a52ff3d4d2963dddd2d (diff) |
Make all uses of QBasicAtomicInt and Pointer use load() and store()
Change Ie3271abd1728af599f9ab17c6f4868e475f17bb6 didn't build on Mac in
debug mode. This commit fixes the build.
Change-Id: I925af83ea577228b60679af804aa7875a779ec3f
Reviewed-on: http://codereview.qt-project.org/6331
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/thread/qmutex.cpp')
-rw-r--r-- | src/corelib/thread/qmutex.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index b2f52500fa..e2da0adf17 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -381,7 +381,7 @@ bool QBasicMutex::lockInternal(int timeout) // we try to aquire the mutex by changing to dummyLocked() if (this->d.testAndSetAcquire(d, dummyLocked())) { // Mutex aquired - Q_ASSERT(d->waiters == -QMutexPrivate::BigNumber || d->waiters == 0); + Q_ASSERT(d->waiters.load() == -QMutexPrivate::BigNumber || d->waiters.load() == 0); d->waiters = 0; d->deref(); return true; @@ -399,7 +399,7 @@ bool QBasicMutex::lockInternal(int timeout) // Mutex was unlocked. if (old_waiters != QMutexPrivate::BigNumber) { //we did not break the previous loop - Q_ASSERT(d->waiters >= 1); + Q_ASSERT(d->waiters.load() >= 1); d->waiters.deref(); } d->deref(); @@ -411,7 +411,7 @@ bool QBasicMutex::lockInternal(int timeout) d->deref(); d->derefWaiters(1); //we got the lock. (do not deref) - Q_ASSERT(d == this->d); + Q_ASSERT(d == this->d.load()); return true; } else { Q_ASSERT(timeout >= 0); @@ -424,7 +424,7 @@ bool QBasicMutex::lockInternal(int timeout) return false; } } - Q_ASSERT(this->d); + Q_ASSERT(this->d.load() != 0); return true; } |