42 #ifndef QATOMIC_SPARC_H
43 #define QATOMIC_SPARC_H
51 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
58 #define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
59 #define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE
66 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
67 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE
74 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
81 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
82 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE
91 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
92 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE
101 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
103 template <
typename T>
106 template <
typename T>
132 const void *expected,
135 const void *expected,
138 Q_CORE_EXPORT
void *
q_atomic_set_ptr(
volatile void *ptr,
const void *newval);
217 template <
typename T>
223 template <
typename T>
229 template <
typename T>
235 template <
typename T>
241 template <
typename T>
247 template <
typename T>
253 template <
typename T>
259 template <
typename T>
265 template <
typename T>
271 template <
typename T>
278 template <
typename T>
284 template <
typename T>
292 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE
299 #define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE
306 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
307 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE
314 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE
321 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE
323 template <
typename T>
326 template <
typename T>
330 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
331 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE
333 template <
typename T>
336 template <
typename T>
340 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE
342 template <
typename T>
345 template <
typename T>
374 if (val == expectedValue) {
421 return originalValue;
439 template <
typename T>
443 if (val == expectedValue) {
451 template <
typename T>
454 return testAndSetOrdered(expectedValue, newValue);
457 template <
typename T>
460 return testAndSetOrdered(expectedValue, newValue);
463 template <
typename T>
466 return testAndSetOrdered(expectedValue, newValue);
469 template <
typename T>
475 template <
typename T>
478 return fetchAndStoreOrdered(newValue);
481 template <
typename T>
484 return fetchAndStoreOrdered(newValue);
487 template <
typename T>
490 return fetchAndStoreOrdered(newValue);
493 template <
typename T>
498 return originalValue;
501 template <
typename T>
504 return fetchAndAddOrdered(valueToAdd);
507 template <
typename T>
510 return fetchAndAddOrdered(valueToAdd);
513 template <
typename T>
516 return fetchAndAddOrdered(valueToAdd);
525 #endif // QATOMIC_SPARC_H
int fetchAndStoreRelaxed(int newValue)
void * q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd)
bool testAndSetRelease(int expectedValue, int newValue)
int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue)
Q_CORE_EXPORT int q_atomic_fetch_and_add_int(volatile int *ptr, int value)
static bool isFetchAndAddNative()
Q_CORE_EXPORT int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expected, void *newval)
int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newValue)
T * fetchAndAddAcquire(qptrdiff valueToAdd)
T * fetchAndAddOrdered(qptrdiff valueToAdd)
Q_CORE_EXPORT void * q_atomic_fetch_and_add_ptr(volatile void *ptr, int value)
int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue)
Q_CORE_EXPORT void q_atomic_unlock(volatile void *addr, int value)
static bool isReferenceCountingNative()
int fetchAndAddRelaxed(int valueToAdd)
Q_CORE_EXPORT int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expected, int newval)
T * fetchAndStoreAcquire(T *newValue)
T * fetchAndAddRelease(qptrdiff valueToAdd)
int fetchAndAddAcquire(int valueToAdd)
static bool isReferenceCountingWaitFree()
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
static bool isFetchAndAddNative()
Q_CORE_EXPORT void * q_atomic_set_ptr(volatile void *ptr, void *newval)
bool testAndSetOrdered(T *expectedValue, T *newValue)
bool testAndSetAcquire(int expectedValue, int newValue)
static bool isFetchAndStoreNative()
#define QT_BEGIN_NAMESPACE
Q_CORE_EXPORT int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value)
static bool isTestAndSetNative()
Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval)
static bool isTestAndSetNative()
static bool isFetchAndStoreNative()
T * fetchAndStoreRelaxed(T *newValue)
Q_CORE_EXPORT int q_atomic_increment(volatile int *ptr)
static bool isFetchAndAddWaitFree()
bool testAndSetRelaxed(int expectedValue, int newValue)
Q_CORE_EXPORT int q_atomic_test_and_set_release_int(volatile int *ptr, int expected, int newval)
Q_CORE_EXPORT int q_atomic_lock_ptr(volatile void *addr)
T * fetchAndStoreRelease(T *newValue)
Q_CORE_EXPORT int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value)
bool testAndSetRelease(T *expectedValue, T *newValue)
void * q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd)
GLenum const GLvoid * addr
static bool isFetchAndStoreWaitFree()
static bool isTestAndSetWaitFree()
GLsizei const GLfloat * value
bool testAndSetAcquire(T *expectedValue, T *newValue)
Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval)
Q_CORE_EXPORT int q_atomic_decrement(volatile int *ptr)
static bool isFetchAndAddWaitFree()
T * fetchAndStoreOrdered(T *newValue)
static bool isFetchAndStoreWaitFree()
bool testAndSetRelaxed(T *expectedValue, T *newValue)
int fetchAndStoreAcquire(int newValue)
Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval)
Q_CORE_EXPORT int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expected, void *newval)
static bool isTestAndSetWaitFree()
bool testAndSetOrdered(int expectedValue, int newValue)
int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newValue)
int fetchAndAddOrdered(int valueToAdd)
int fetchAndStoreOrdered(int newValue)
Q_CORE_EXPORT int q_atomic_lock_int(volatile int *addr)
int fetchAndAddRelease(int valueToAdd)
int fetchAndStoreRelease(int newValue)