diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:17:13 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:17:51 +0200 |
commit | 4dac45c9ee59ff6586d90d423654da91523ab679 (patch) | |
tree | cd4a4adf2cbc9e77bf86d2d11e71ec66afdf3be4 /src/corelib/thread/qatomic.h | |
parent | 078cd61751aeaa310d35a3d596a21a36004a1a0f (diff) | |
parent | f44850b5c3464cdda0ee9b1ee858d95f3ffaa3e2 (diff) |
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
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); |