Add complete set of atomit_store-operations
This commit is contained in:
@ -73,8 +73,10 @@ void* atomic_load_ptr(void * const *variable);
|
|||||||
* @param variable Pointer the the variable to store to
|
* @param variable Pointer the the variable to store to
|
||||||
* @param value Value to be stored
|
* @param value Value to be stored
|
||||||
*/
|
*/
|
||||||
void atomic_store_int32(int *variable, int value);
|
void atomic_store_int(int *variable, int value);
|
||||||
|
void atomic_store_int32(int32_t *variable, int32_t value);
|
||||||
void atomic_store_int64(int64_t *variable, int64_t value);
|
void atomic_store_int64(int64_t *variable, int64_t value);
|
||||||
|
void atomic_store_uint32(uint32_t *variable, uint32_t value);
|
||||||
void atomic_store_uint64(uint64_t *variable, uint64_t value);
|
void atomic_store_uint64(uint64_t *variable, uint64_t value);
|
||||||
void atomic_store_ptr(void **variable, void *value);
|
void atomic_store_ptr(void **variable, void *value);
|
||||||
|
|
||||||
|
|||||||
@ -107,7 +107,18 @@ void* atomic_load_ptr(void * const *variable)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void atomic_store_int32(int *variable, int value)
|
void atomic_store_int(int *variable, int value)
|
||||||
|
{
|
||||||
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
|
#else
|
||||||
|
__sync_synchronize();
|
||||||
|
*variable = value;
|
||||||
|
__sync_synchronize();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void atomic_store_int32(int32_t *variable, int32_t value)
|
||||||
{
|
{
|
||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
@ -129,6 +140,17 @@ void atomic_store_int64(int64_t *variable, int64_t value)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void atomic_store_uint32(uint32_t *variable, uint32_t value)
|
||||||
|
{
|
||||||
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
|
#else
|
||||||
|
__sync_synchronize();
|
||||||
|
*variable = value;
|
||||||
|
__sync_synchronize();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void atomic_store_uint64(uint64_t *variable, uint64_t value)
|
void atomic_store_uint64(uint64_t *variable, uint64_t value)
|
||||||
{
|
{
|
||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
|
|||||||
Reference in New Issue
Block a user