diff options
Diffstat (limited to 'src/corelib/thread/qatomic.h')
-rw-r--r-- | src/corelib/thread/qatomic.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index 280ce96b76..a3b9be0729 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -81,8 +81,10 @@ public: #ifdef Q_CLANG_QDOC T load() const; + T loadRelaxed() const; T loadAcquire() const; void store(T newValue); + void storeRelaxed(T newValue); void storeRelease(T newValue); operator T() const; @@ -172,7 +174,7 @@ public: #else inline QAtomicPointer(T *value = nullptr) noexcept { - this->store(value); + this->storeRelaxed(value); } #endif inline QAtomicPointer(const QAtomicPointer<T> &other) noexcept @@ -255,7 +257,7 @@ inline void qAtomicAssign(T *&d, T *x) template <typename T> inline void qAtomicDetach(T *&d) { - if (d->ref.load() == 1) + if (d->ref.loadRelaxed() == 1) return; T *x = d; d = new T(*d); |