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 <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2019-06-10 11:40:16 +02:00
parent cd401b74a1
commit 79bdc7cf1d

View File

@ -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); }