42 #ifndef QATOMIC_M68K_H
43 #define QATOMIC_M68K_H
49 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
56 #define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
63 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
64 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE
71 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
78 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
87 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
88 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE
97 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
102 template <
typename T>
108 return __sync_add_and_fetch(&
_q_value, 1);
113 return __sync_sub_and_fetch(&
_q_value, 1);
118 return __sync_bool_compare_and_swap(&
_q_value, expectedValue, newValue);
138 return __sync_lock_test_and_set(&
_q_value, newValue);
158 return __sync_fetch_and_add(&
_q_value, valueToAdd);
176 template <
typename T>
179 return __sync_bool_compare_and_swap(&_q_value, expectedValue, newValue);
182 template <
typename T>
185 return testAndSetOrdered(expectedValue, newValue);
188 template <
typename T>
191 return testAndSetOrdered(expectedValue, newValue);
194 template <
typename T>
197 return testAndSetOrdered(expectedValue, newValue);
200 template <
typename T>
203 return __sync_lock_test_and_set(&_q_value, newValue);
206 template <
typename T>
209 return fetchAndStoreOrdered(newValue);
212 template <
typename T>
215 return fetchAndStoreOrdered(newValue);
218 template <
typename T>
221 return fetchAndStoreOrdered(newValue);
224 template <
typename T>
227 return __sync_fetch_and_add(&_q_value, valueToAdd *
sizeof(T));
230 template <
typename T>
233 return fetchAndAddOrdered(valueToAdd);
236 template <
typename T>
239 return fetchAndAddOrdered(valueToAdd);
242 template <
typename T>
245 return fetchAndAddOrdered(valueToAdd);
252 #endif // QATOMIC_M68K_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)