Clean up atomic_load-functions
This commit is contained in:
@ -57,8 +57,10 @@ uint64_t atomic_add_uint64(uint64_t *variable, int64_t value);
|
|||||||
* @param variable Pointer the the variable to load from
|
* @param variable Pointer the the variable to load from
|
||||||
* @return The stored value
|
* @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);
|
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);
|
uint64_t atomic_load_uint64(const uint64_t *variable);
|
||||||
void* atomic_load_ptr(void * const *variable);
|
void* atomic_load_ptr(void * const *variable);
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,16 @@ uint64_t atomic_add_uint64(uint64_t *variable, int64_t value)
|
|||||||
#endif
|
#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
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||||
@ -71,6 +80,15 @@ int64_t atomic_load_int64(const int64_t *variable)
|
|||||||
#endif
|
#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)
|
uint64_t atomic_load_uint64(const uint64_t *variable)
|
||||||
{
|
{
|
||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
|
|||||||
Reference in New Issue
Block a user