Document the new load / store methods in QAtomic{Int,Pointer}

Task-number: QTBUG-24627

Change-Id: Iaa2573aa8f0f36cac81efa73020c2f365bfcba53
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Thiago Macieira 2012-12-11 14:24:05 -08:00 committed by The Qt Project
parent 817bec7a23
commit 4955cd8539
2 changed files with 86 additions and 0 deletions

View File

@ -216,6 +216,44 @@
this QAtomicInt. 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() /*! \fn bool QAtomicInt::isReferenceCountingNative()
Returns true if reference counting is implemented using atomic Returns true if reference counting is implemented using atomic
@ -750,6 +788,44 @@
this QAtomicPointer. 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() /*! \fn bool QAtomicPointer::isTestAndSetNative()
Returns true if test-and-set is implemented using atomic processor Returns true if test-and-set is implemented using atomic processor

View File

@ -82,6 +82,11 @@ public:
} }
#ifdef qdoc #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 isReferenceCountingNative();
static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree(); static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree();
@ -139,6 +144,11 @@ public:
} }
#ifdef qdoc #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 isTestAndSetNative();
static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree(); static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree();