42 #include "qplatformdefs.h" 44 #include <QtCore/qatomic.h> 65 bool returnValue =
false;
66 qAtomicCriticalSection.
lock();
67 if (*_q_value == expectedValue) {
71 qAtomicCriticalSection.
unlock();
79 qAtomicCriticalSection.
lock();
80 returnValue = *_q_value;
82 qAtomicCriticalSection.
unlock();
90 qAtomicCriticalSection.
lock();
91 returnValue = *_q_value;
92 *_q_value += valueToAdd;
93 qAtomicCriticalSection.
unlock();
102 bool returnValue =
false;
103 qAtomicCriticalSection.
lock();
104 if (*_q_value == expectedValue) {
105 *_q_value = newValue;
108 qAtomicCriticalSection.
unlock();
116 qAtomicCriticalSection.
lock();
117 returnValue = *_q_value;
118 *_q_value = newValue;
119 qAtomicCriticalSection.
unlock();
127 qAtomicCriticalSection.
lock();
128 returnValue = *_q_value;
129 *_q_value =
reinterpret_cast<char *
>(returnValue) + valueToAdd;
130 qAtomicCriticalSection.
unlock();
Q_CORE_EXPORT void * QBasicAtomicPointer_fetchAndStoreOrdered(void *volatile *_q_value, void *newValue)
#define QT_END_NAMESPACE
This macro expands to.
Q_CORE_EXPORT bool QBasicAtomicInt_testAndSetOrdered(volatile int *_q_value, int expectedValue, int newValue)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QIntegerForSizeof< void * >::Signed qptrdiff
Q_CORE_EXPORT bool QBasicAtomicPointer_testAndSetOrdered(void *volatile *_q_value, void *expectedValue, void *newValue)
Q_CORE_EXPORT void * QBasicAtomicPointer_fetchAndAddOrdered(void *volatile *_q_value, qptrdiff valueToAdd)
Q_CORE_EXPORT int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *_q_value, int newValue)
Q_CORE_EXPORT int QBasicAtomicInt_fetchAndAddOrdered(volatile int *_q_value, int valueToAdd)
static QCriticalSection qAtomicCriticalSection