Clean up atomic_load-functions
This commit is contained in:
parent
b8c78ca9fe
commit
9093f19c8b
@ -57,8 +57,10 @@ uint64_t atomic_add_uint64(uint64_t *variable, int64_t value);
|
||||
* @param variable Pointer the the variable to load from
|
||||
* @return The stored value
|
||||
*/
|
||||
int atomic_load_int32(const int *variable);
|
||||
int atomic_load_int(const int *variable);
|
||||
int32_t atomic_load_int32(const int32_t *variable);
|
||||
int64_t atomic_load_int64(const int64_t *variable);
|
||||
uint32_t atomic_load_uint32(const uint32_t *variable);
|
||||
uint64_t atomic_load_uint64(const uint64_t *variable);
|
||||
void* atomic_load_ptr(void * const *variable);
|
||||
|
||||
|
@ -53,7 +53,16 @@ uint64_t atomic_add_uint64(uint64_t *variable, int64_t value)
|
||||
#endif
|
||||
}
|
||||
|
||||
int atomic_load_int32(const int *variable)
|
||||
int atomic_load_int(const int *variable)
|
||||
{
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t atomic_load_int32(const int32_t *variable)
|
||||
{
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
@ -71,6 +80,15 @@ int64_t atomic_load_int64(const int64_t *variable)
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t atomic_load_uint32(const uint32_t *variable)
|
||||
{
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
return __sync_fetch_and_or(variable, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t atomic_load_uint64(const uint64_t *variable)
|
||||
{
|
||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||
|
Loading…
x
Reference in New Issue
Block a user