summaryrefslogtreecommitdiff
path: root/include/atomic/gcc_builtins.h
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2009-11-17 17:11:32 -0700
committerMarc Alff <marc.alff@sun.com>2009-11-17 17:11:32 -0700
commit382ae222902919f37ae749acada48ee05e3704e6 (patch)
tree4b3f59fa13833492f961ebb9857d1149467a9db8 /include/atomic/gcc_builtins.h
parent7d59878096611f3869aef17fe2658d6beffd7823 (diff)
downloadmariadb-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.h5
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) \