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 <lars.knoll@digia.com>
This commit is contained in:
Thiago Macieira 2013-12-02 20:27:54 -08:00 committed by The Qt Project
parent aba30f0234
commit 8e26730fb7

View File

@ -74,12 +74,12 @@ public:
: QBasicAtomicInteger<T>() : QBasicAtomicInteger<T>()
#endif #endif
{ {
this->store(other.load()); this->storeRelease(other.loadAcquire());
} }
inline QAtomicInteger &operator=(const QAtomicInteger &other) Q_DECL_NOTHROW inline QAtomicInteger &operator=(const QAtomicInteger &other) Q_DECL_NOTHROW
{ {
this->store(other.load()); this->storeRelease(other.loadAcquire());
return *this; return *this;
} }
@ -148,12 +148,12 @@ public:
#endif #endif
inline QAtomicPointer(const QAtomicPointer<T> &other) Q_DECL_NOTHROW inline QAtomicPointer(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
{ {
this->store(other.load()); this->storeRelease(other.loadAcquire());
} }
inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other) Q_DECL_NOTHROW inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
{ {
this->store(other.load()); this->storeRelease(other.loadAcquire());
return *this; return *this;
} }