From 79bdc7cf1daec75df59de9236599a9f24077511a Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 10 Jun 2019 11:40:16 +0200 Subject: Deprecate QAtomic::load() / store() Tell people to move to loadRelaxed() / storeRelaxed(), now that we have them. [ChangeLog][QtCore][QAtomicInteger] The load() / store() functions have been deprecated in favor of loadRelaxed() / storeRelaxed(). [ChangeLog][QtCore][QAtomicPointer] The load() / store() functions have been deprecated in favor of loadRelaxed() / storeRelaxed(). Change-Id: If7a31db2f90fce4a7605a2377067e86990646f48 Reviewed-by: Thiago Macieira --- src/corelib/thread/qbasicatomic.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/corelib/thread/qbasicatomic.h') diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index dc976819ef..9804e60119 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -99,8 +99,10 @@ public: typename Ops::Type _q_value; // Everything below is either implemented in ../arch/qatomic_XXX.h or (as fallback) in qgenericatomic.h - T load() const noexcept { return loadRelaxed(); } - void store(T newValue) noexcept { storeRelaxed(newValue); } +#if QT_DEPRECATED_SINCE(5, 14) + QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") T load() const noexcept { return loadRelaxed(); } + QT_DEPRECATED_VERSION_X_5_14("Use storeRelaxed") void store(T newValue) noexcept { storeRelaxed(newValue); } +#endif T loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); } void storeRelaxed(T newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); } @@ -238,8 +240,10 @@ public: AtomicType _q_value; - Type load() const noexcept { return loadRelaxed(); } - void store(Type newValue) noexcept { storeRelaxed(newValue); } +#if QT_DEPRECATED_SINCE(5, 14) + QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") Type load() const noexcept { return loadRelaxed(); } + QT_DEPRECATED_VERSION_X_5_14("Use storeRelaxed") void store(Type newValue) noexcept { storeRelaxed(newValue); } +#endif Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); } void storeRelaxed(Type newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); } -- cgit v1.2.3