From 29076cf6cbd22e2e16a730787c79c2734655756e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 29 Apr 2016 20:52:05 -0700 Subject: Fix QBasicAtomicPointer::{load,store} to actually be relaxed We were using direct loading and operator=, which for everything except std::atomic was very relaxed. But std::atomic defines the direct access to actually be the least relaxed possible, under the idea that if you didn't know any better to use a member function, you probably need the most protection. So use Ops::load and Ops::store. Change-Id: Id5480807d25e49e78b79ffff144a06a2e6398576 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/thread/qbasicatomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/thread/qbasicatomic.h') diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index c29b80d3d0..7960174277 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -249,8 +249,8 @@ public: AtomicType _q_value; - Type load() const Q_DECL_NOTHROW { return _q_value; } - void store(Type newValue) Q_DECL_NOTHROW { _q_value = newValue; } + Type load() const Q_DECL_NOTHROW { return Ops::load(_q_value); } + void store(Type newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); } operator Type() const Q_DECL_NOTHROW { return loadAcquire(); } Type operator=(Type newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; } -- cgit v1.2.3