From 8e26730fb7296e42d050aaa3b4af65a17f512701 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 2 Dec 2013 20:27:54 -0800 Subject: Use full-barrier in the "non-atomic" API in QAtomic{Int,Integer,Pointer} This is more in line with what std::atomic does. Change-Id: I6fe96102995a3fda8f82475758995593358735bc Reviewed-by: Lars Knoll --- src/corelib/thread/qatomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index 1bfadc4442..d79e168cb3 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -74,12 +74,12 @@ public: : QBasicAtomicInteger() #endif { - this->store(other.load()); + this->storeRelease(other.loadAcquire()); } inline QAtomicInteger &operator=(const QAtomicInteger &other) Q_DECL_NOTHROW { - this->store(other.load()); + this->storeRelease(other.loadAcquire()); return *this; } @@ -148,12 +148,12 @@ public: #endif inline QAtomicPointer(const QAtomicPointer &other) Q_DECL_NOTHROW { - this->store(other.load()); + this->storeRelease(other.loadAcquire()); } inline QAtomicPointer &operator=(const QAtomicPointer &other) Q_DECL_NOTHROW { - this->store(other.load()); + this->storeRelease(other.loadAcquire()); return *this; } -- cgit v1.2.3