From 3b48a65e99839c9427923c03b4e2a87a8465d165 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 14 Oct 2013 16:57:32 +0200 Subject: QBasicAtomicInt: fix wrong comment about non-atomic API The public documentation for load() and store() says it's atomic, and it is: * using _q_value.store(newValue, std::memory_order_relaxed) in the C++11 implementation * using a simple assignment otherwise, which is atomic (and relaxed, no memory barriers) on all the existing C++ ABIs. Change-Id: I40faa47120163225bd11c3a32514ac97ef8bbbd4 Reviewed-by: Thiago Macieira --- src/corelib/thread/qbasicatomic.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/corelib/thread/qbasicatomic.h') diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index ddcc25f7b7..782ae90698 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -137,12 +137,11 @@ public: typename Ops::Type _q_value; - // Non-atomic API + // Everything below is either implemented in ../arch/qatomic_XXX.h or (as fallback) in qgenericatomic.h + T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); } void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); } - // Atomic API, implemented in qatomic_XXX.h - T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); } void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); } -- cgit v1.2.3