42 #ifndef QATOMIC_INTEGRITY_H
43 #define QATOMIC_INTEGRITY_H
45 #include <INTEGRITY.h>
51 #define qt_pp2addrp(a) reinterpret_cast<Address *>(const_cast<T **>(a))
52 #define qt_ip2addrp(a) reinterpret_cast<Address *>(const_cast<int *>(a))
53 #define qt_p2addrp(a) reinterpret_cast<Address *>(a)
54 #define qt_addr(a) reinterpret_cast<Address>(a)
57 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
62 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_WAIT_FREE
67 #define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
72 #define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE
77 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
82 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE
87 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
92 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_WAIT_FREE
97 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
103 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_WAIT_FREE
105 template <
typename T>
109 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
111 template <
typename T>
115 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE
117 template <
typename T>
121 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
123 template <
typename T>
127 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE
129 template <
typename T>
224 template <
typename T>
230 template <
typename T>
233 return testAndSetOrdered(expectedValue, newValue);
236 template <
typename T>
239 return testAndSetOrdered(expectedValue, newValue);
242 template <
typename T>
245 return testAndSetOrdered(expectedValue, newValue);
250 template <
typename T>
257 }
while (TestAndSet(
qt_pp2addrp(&_q_value), old_value,
qt_addr(newValue)) != Success);
259 return reinterpret_cast<T *
>(old_value);
262 template <
typename T>
265 return fetchAndStoreOrdered(newValue);
268 template <
typename T>
271 return fetchAndStoreOrdered(newValue);
274 template <
typename T>
277 return fetchAndStoreOrdered(newValue);
282 template <
typename T>
286 AtomicModify(
qt_pp2addrp(&_q_value), &old_value, 0, valueToAdd *
sizeof(T));
288 return reinterpret_cast<T *
>(old_value);
291 template <
typename T>
294 return fetchAndAddOrdered(valueToAdd);
297 template <
typename T>
300 return fetchAndAddOrdered(valueToAdd);
303 template <
typename T>
306 return fetchAndAddOrdered(valueToAdd);
313 #endif // QATOMIC_INTEGRITY_H
int fetchAndStoreRelaxed(int newValue)
bool testAndSetRelease(int expectedValue, int newValue)
static bool isFetchAndAddNative()
T * fetchAndAddAcquire(qptrdiff valueToAdd)
T * fetchAndAddOrdered(qptrdiff valueToAdd)
static bool isReferenceCountingNative()
int fetchAndAddRelaxed(int valueToAdd)
T * fetchAndStoreAcquire(T *newValue)
T * fetchAndAddRelease(qptrdiff valueToAdd)
int fetchAndAddAcquire(int valueToAdd)
static bool isReferenceCountingWaitFree()
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
static bool isFetchAndAddNative()
bool testAndSetOrdered(T *expectedValue, T *newValue)
bool testAndSetAcquire(int expectedValue, int newValue)
static bool isFetchAndStoreNative()
#define QT_BEGIN_NAMESPACE
static bool isTestAndSetNative()
static bool isTestAndSetNative()
static bool isFetchAndStoreNative()
T * fetchAndStoreRelaxed(T *newValue)
static bool isFetchAndAddWaitFree()
bool testAndSetRelaxed(int expectedValue, int newValue)
T * fetchAndStoreRelease(T *newValue)
bool testAndSetRelease(T *expectedValue, T *newValue)
static bool isFetchAndStoreWaitFree()
static bool isTestAndSetWaitFree()
bool testAndSetAcquire(T *expectedValue, T *newValue)
static bool isFetchAndAddWaitFree()
T * fetchAndStoreOrdered(T *newValue)
static bool isFetchAndStoreWaitFree()
bool testAndSetRelaxed(T *expectedValue, T *newValue)
int fetchAndStoreAcquire(int newValue)
static bool isTestAndSetWaitFree()
bool testAndSetOrdered(int expectedValue, int newValue)
int fetchAndAddOrdered(int valueToAdd)
int fetchAndStoreOrdered(int newValue)
int fetchAndAddRelease(int valueToAdd)
int fetchAndStoreRelease(int newValue)