Linux tweaks.
This commit is contained in:
@@ -102,17 +102,17 @@ inline int32_t atomic_dec(volatile int32_t* value) {
|
||||
}
|
||||
|
||||
inline int32_t atomic_exchange(int32_t new_value, volatile int32_t* value) {
|
||||
return __sync_val_compare_and_swap(*value, value, new_value);
|
||||
return __sync_val_compare_and_swap(value, *value, new_value);
|
||||
}
|
||||
inline int64_t atomic_exchange(int64_t new_value, volatile int64_t* value) {
|
||||
return __sync_val_compare_and_swap(*value, value, new_value);
|
||||
return __sync_val_compare_and_swap(value, *value, new_value);
|
||||
}
|
||||
|
||||
inline int32_t atomic_exchange_add(int32_t amount, volatile int32_t* value) {
|
||||
return __sync_fetch_and_add(amount, value);
|
||||
return __sync_fetch_and_add(value, amount);
|
||||
}
|
||||
inline int64_t atomic_exchange_add(int64_t amount, volatile int64_t* value) {
|
||||
return __sync_fetch_and_add(amount, value);
|
||||
return __sync_fetch_and_add(value, amount);
|
||||
}
|
||||
|
||||
inline bool atomic_cas(int32_t old_value, int32_t new_value,
|
||||
|
||||
Reference in New Issue
Block a user