summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qbasicatomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qbasicatomic.h')
-rw-r--r--src/corelib/thread/qbasicatomic.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 7d2e06a499..dc976819ef 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -99,9 +99,11 @@ 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); }
- T load() const noexcept { return Ops::load(_q_value); }
- void store(T newValue) noexcept { Ops::store(_q_value, newValue); }
+ T loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
+ void storeRelaxed(T newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); }
T loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); }
void storeRelease(T newValue) noexcept { Ops::storeRelease(_q_value, newValue); }
@@ -236,8 +238,12 @@ public:
AtomicType _q_value;
- Type load() const noexcept { return Ops::load(_q_value); }
- void store(Type newValue) noexcept { Ops::store(_q_value, newValue); }
+ Type load() const noexcept { return loadRelaxed(); }
+ void store(Type newValue) noexcept { storeRelaxed(newValue); }
+
+ Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
+ void storeRelaxed(Type newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); }
+
operator Type() const noexcept { return loadAcquire(); }
Type operator=(Type newValue) noexcept { storeRelease(newValue); return newValue; }