Use QAtomicInt::store() instead of operator=(int)
authorBradley T. Hughes <bradley.hughes@nokia.com>
Mon, 31 Oct 2011 11:35:12 +0000 (12:35 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 Nov 2011 00:51:32 +0000 (01:51 +0100)
... since the latter is now deprecated and will be removed.

Change-Id: I456c1bf93ebf119c028bc4a63f1f8a31f069b83b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/corelib/thread/qmutex.cpp

index 6ba0a8c..df36120 100644 (file)
@@ -388,7 +388,7 @@ bool QBasicMutex::lockInternal(int timeout)
                 if (d_ptr.testAndSetAcquire(d, dummyLocked())) {
                     // Mutex aquired
                     Q_ASSERT(d->waiters.load() == -QMutexPrivate::BigNumber || d->waiters.load() == 0);
-                    d->waiters = 0;
+                    d->waiters.store(0);
                     d->deref();
                     return true;
                 } else {
@@ -491,7 +491,7 @@ QMutexPrivate *QMutexPrivate::allocate()
     Q_ASSERT(!d->recursive);
     Q_ASSERT(!d->possiblyUnlocked.load());
     Q_ASSERT(d->waiters.load() == 0);
-    d->refCount = 1;
+    d->refCount.store(1);
     return d;
 }