summaryrefslogtreecommitdiff
path: root/include/my_atomic_wrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_atomic_wrapper.h')
-rw-r--r--include/my_atomic_wrapper.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/my_atomic_wrapper.h b/include/my_atomic_wrapper.h
index d57559d360d..c5820b4f5b6 100644
--- a/include/my_atomic_wrapper.h
+++ b/include/my_atomic_wrapper.h
@@ -43,9 +43,10 @@ public:
Type load(std::memory_order o= std::memory_order_relaxed) const
{ return m.load(o); }
+ void store(Type i, std::memory_order o= std::memory_order_relaxed)
+ { m.store(i, o); }
operator Type() const { return m.load(); }
- Type operator=(const Type val)
- { m.store(val, std::memory_order_relaxed); return val; }
+ Type operator=(const Type i) { store(i); return i; }
Type operator=(const Atomic_relaxed<Type> &rhs) { return *this= Type{rhs}; }
Type fetch_add(const Type i, std::memory_order o= std::memory_order_relaxed)
{ return m.fetch_add(i, o); }