From 6476ac738ca029af95932f53b53f0705808eb80e Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 29 Sep 2011 11:50:08 +0200 Subject: Replace implicit QAtomic* casts with explicit load()/store() Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira --- src/corelib/thread/qmutex_p.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib/thread/qmutex_p.h') diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h index 00f071ebef..00bda48e5b 100644 --- a/src/corelib/thread/qmutex_p.h +++ b/src/corelib/thread/qmutex_p.h @@ -79,21 +79,21 @@ public: int id; bool ref() { - Q_ASSERT(refCount >= 0); + Q_ASSERT(refCount.load() >= 0); int c; do { - c = refCount; + c = refCount.load(); if (c == 0) return false; } while (!refCount.testAndSetRelaxed(c, c + 1)); - Q_ASSERT(refCount >= 0); + Q_ASSERT(refCount.load() >= 0); return true; } void deref() { - Q_ASSERT(refCount >=0); + Q_ASSERT(refCount.load() >= 0); if (!refCount.deref()) release(); - Q_ASSERT(refCount >=0); + Q_ASSERT(refCount.load() >= 0); } void release(); static QMutexPrivate *allocate(); -- cgit v1.2.3