summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-04-29 20:52:05 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-05-09 05:30:49 +0000
commit29076cf6cbd22e2e16a730787c79c2734655756e (patch)
treed018cb6e287396e92d4e15b26760d114ca89c6de /src
parentad66dbe305cff72443f4d3484191872d56e6dfbb (diff)
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<T *> 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) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qbasicatomic.h4
1 files changed, 2 insertions, 2 deletions
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; }