42 #ifndef QBASICATOMIC_H 43 #define QBASICATOMIC_H 45 #include <QtCore/qglobal.h> 59 #if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) 61 volatile long _q_value;
70 return _q_value == value;
75 return _q_value != value;
83 inline operator int()
const 91 this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
99 static bool isReferenceCountingNative();
100 static bool isReferenceCountingWaitFree();
105 static bool isTestAndSetNative();
106 static bool isTestAndSetWaitFree();
108 bool testAndSetRelaxed(
int expectedValue,
int newValue);
109 bool testAndSetAcquire(
int expectedValue,
int newValue);
110 bool testAndSetRelease(
int expectedValue,
int newValue);
111 bool testAndSetOrdered(
int expectedValue,
int newValue);
113 static bool isFetchAndStoreNative();
114 static bool isFetchAndStoreWaitFree();
116 int fetchAndStoreRelaxed(
int newValue);
117 int fetchAndStoreAcquire(
int newValue);
118 int fetchAndStoreRelease(
int newValue);
119 int fetchAndStoreOrdered(
int newValue);
121 static bool isFetchAndAddNative();
122 static bool isFetchAndAddWaitFree();
124 int fetchAndAddRelaxed(
int valueToAdd);
125 int fetchAndAddAcquire(
int valueToAdd);
126 int fetchAndAddRelease(
int valueToAdd);
127 int fetchAndAddOrdered(
int valueToAdd);
130 template <
typename T>
134 #ifdef QT_ARCH_PARISC 137 #if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) 140 # if !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) 145 volatile _q_value_integral;
154 return _q_value == value;
167 inline operator T *()
const 179 #ifdef QT_ARCH_PARISC 180 this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
213 #ifdef QT_ARCH_PARISC 214 # define Q_BASIC_ATOMIC_INITIALIZER(a) {{-1,-1,-1,-1},(a)} 215 #elif defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) 216 # define Q_BASIC_ATOMIC_INITIALIZER(a) { {(a)} } 218 # define Q_BASIC_ATOMIC_INITIALIZER(a) { (a) } 224 #if defined(QT_MOC) || defined(QT_BUILD_QMAKE) || defined(QT_RCC) || defined(QT_UIC) || defined(QT_BOOTSTRAPPED) 225 # include <QtCore/qatomic_bootstrap.h> 227 # include <QtCore/qatomic_arch.h> 230 #endif // QBASIC_ATOMIC
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
#define QT_END_NAMESPACE
This macro expands to.
static bool isFetchAndAddNative()
static bool isTestAndSetNative()
T * fetchAndStoreRelease(T *newValue)
static bool isTestAndSetWaitFree()
T * fetchAndAddRelease(qptrdiff valueToAdd)
bool testAndSetOrdered(T *expectedValue, T *newValue)
T * fetchAndAddAcquire(qptrdiff valueToAdd)
T * fetchAndAddOrdered(qptrdiff valueToAdd)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QIntegerForSizeof< void * >::Signed qptrdiff
T * fetchAndStoreOrdered(T *newValue)
QBasicAtomicPointer< T > & operator=(T *value)
T * fetchAndStoreAcquire(T *newValue)
static bool isFetchAndStoreWaitFree()
static bool isFetchAndAddWaitFree()
bool operator==(T *value) const
bool operator!=(int value) const
bool testAndSetRelaxed(T *expectedValue, T *newValue)
bool operator!=(T *value) const
bool operator==(int value) const
QBasicAtomicInt & operator=(int value)
bool testAndSetRelease(T *expectedValue, T *newValue)
T * fetchAndStoreRelaxed(T *newValue)
static bool isFetchAndStoreNative()
bool testAndSetAcquire(T *expectedValue, T *newValue)