diff options
author | Marc Alff <marc.alff@sun.com> | 2009-11-17 17:11:32 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2009-11-17 17:11:32 -0700 |
commit | 382ae222902919f37ae749acada48ee05e3704e6 (patch) | |
tree | 4b3f59fa13833492f961ebb9857d1149467a9db8 /include/atomic/gcc_builtins.h | |
parent | 7d59878096611f3869aef17fe2658d6beffd7823 (diff) | |
download | mariadb-git-382ae222902919f37ae749acada48ee05e3704e6.tar.gz |
WL#2595 kernel-independent atomic operations
Backport from 6.0.14 to 5.6.0
Original code from Sergei Golubchik
Diffstat (limited to 'include/atomic/gcc_builtins.h')
-rw-r--r-- | include/atomic/gcc_builtins.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h index 01ebc38707e..100ff80cacd 100644 --- a/include/atomic/gcc_builtins.h +++ b/include/atomic/gcc_builtins.h @@ -18,7 +18,7 @@ #define make_atomic_add_body(S) \ v= __sync_fetch_and_add(a, v); -#define make_atomic_swap_body(S) \ +#define make_atomic_fas_body(S) \ v= __sync_lock_test_and_set(a, v); #define make_atomic_cas_body(S) \ int ## S sav; \ @@ -28,7 +28,10 @@ #ifdef MY_ATOMIC_MODE_DUMMY #define make_atomic_load_body(S) ret= *a #define make_atomic_store_body(S) *a= v +#define MY_ATOMIC_MODE "gcc-builtins-up" + #else +#define MY_ATOMIC_MODE "gcc-builtins-smp" #define make_atomic_load_body(S) \ ret= __sync_fetch_and_or(a, 0); #define make_atomic_store_body(S) \ |