Document the new load / store methods in QAtomic{Int,Pointer}
authorThiago Macieira <thiago.macieira@intel.com>
Tue, 11 Dec 2012 22:24:05 +0000 (14:24 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 12 Dec 2012 00:17:27 +0000 (01:17 +0100)
Task-number: QTBUG-24627

Change-Id: Iaa2573aa8f0f36cac81efa73020c2f365bfcba53
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/thread/qatomic.cpp
src/corelib/thread/qatomic.h

index 791f410..ef74ac4 100644 (file)
     this QAtomicInt.
 */
 
+/*!
+    \fn int QAtomicInt::load() const
+
+    Atomically loads the value of this QAtomicInt using relaxed memory
+    ordering. The value is not modified in any way, but note that there's no
+    guarantee that it remains so.
+
+    \sa store(), loadAcquire()
+*/
+
+/*!
+    \fn int QAtomicInt::loadAcquire() const
+
+    Atomically loads the value of this QAtomicInt using the "Acquire" memory
+    ordering. The value is not modified in any way, but note that there's no
+    guarantee that it remains so.
+
+    \sa store(), load()
+*/
+
+/*!
+    \fn void QAtomicInt::store(int newValue)
+
+    Atomically stores the \a newValue value into this atomic type, using
+    relaxed memory ordering.
+
+    \sa storeRelease(), load()
+*/
+
+/*!
+    \fn void QAtomicInt::storeRelease(int newValue)
+
+    Atomically stores the \a newValue value into this atomic type, using
+    the "Release" memory ordering.
+
+    \sa store(), load()
+*/
+
 /*! \fn bool QAtomicInt::isReferenceCountingNative()
 
     Returns true if reference counting is implemented using atomic
     this QAtomicPointer.
 */
 
+/*!
+    \fn T *QAtomicPointer::load() const
+
+    Atomically loads the value of this QAtomicPointer using relaxed memory
+    ordering. The value is not modified in any way, but note that there's no
+    guarantee that it remains so.
+
+    \sa store(), loadAcquire()
+*/
+
+/*!
+    \fn T *QAtomicPointer::loadAcquire() const
+
+    Atomically loads the value of this QAtomicPointerusing the "Acquire" memory
+    ordering. The value is not modified in any way, but note that there's no
+    guarantee that it remains so.
+
+    \sa store(), load()
+*/
+
+/*!
+    \fn void QAtomicPointer::store(T *newValue)
+
+    Atomically stores the \a newValue value into this atomic type, using
+    relaxed memory ordering.
+
+    \sa storeRelease(), load()
+*/
+
+/*!
+    \fn void QAtomicPointer::storeRelease(T *newValue)
+
+    Atomically stores the \a newValue value into this atomic type, using
+    the "Release" memory ordering.
+
+    \sa store(), load()
+*/
+
 /*! \fn bool QAtomicPointer::isTestAndSetNative()
 
     Returns true if test-and-set is implemented using atomic processor
index 076cfba..1000180 100644 (file)
@@ -82,6 +82,11 @@ public:
     }
 
 #ifdef qdoc
+    int load() const;
+    int loadAcquire() const;
+    void store(int newValue);
+    void storeRelease(int newValue);
+
     static Q_DECL_CONSTEXPR bool isReferenceCountingNative();
     static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree();
 
@@ -139,6 +144,11 @@ public:
     }
 
 #ifdef qdoc
+    T *load() const;
+    T *loadAcquire() const;
+    void store(T *newValue);
+    void storeRelease(T *newValue);
+
     static Q_DECL_CONSTEXPR bool isTestAndSetNative();
     static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree();