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>
This commit is contained in:
Bradley T. Hughes 2011-10-10 14:41:37 +02:00 committed by Qt by Nokia
parent ac03f59ccc
commit 78470cd621

View File

@ -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;
}