summaryrefslogtreecommitdiff
path: root/include/my_atomic.h
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2008-10-13 22:03:12 +0200
committerMikael Ronstrom <mikael@mysql.com>2008-10-13 22:03:12 +0200
commite82dac8dab6215e71ae362b04415142622fb0995 (patch)
tree23d558b2aceb008e4d8a9df706ae32017760d722 /include/my_atomic.h
parent9daa56fd5ce3ccd33c32b5a505ac1d2b2c437460 (diff)
downloadmariadb-git-e82dac8dab6215e71ae362b04415142622fb0995.tar.gz
Performance patch: Mysql atomic patch
Diffstat (limited to 'include/my_atomic.h')
-rw-r--r--include/my_atomic.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/my_atomic.h b/include/my_atomic.h
index ed439e5fe87..03f7d081981 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -18,13 +18,21 @@
#define intptr void *
#ifndef MY_ATOMIC_MODE_RWLOCKS
+/*
+ * Attempt to do atomic ops without locks
+ */
#include "atomic/nolock.h"
#endif
-#ifndef make_atomic_cas_body
+#ifndef MY_ATOMIC_NOLOCK
+/*
+ * Have to use rw-locks for atomic ops
+ */
#include "atomic/rwlock.h"
#endif
+#ifndef MY_ATOMICS_MADE
+
#ifndef make_atomic_add_body
#define make_atomic_add_body(S) \
int ## S tmp=*a; \
@@ -91,7 +99,7 @@ extern int ## S my_atomic_load ## S(int ## S volatile *a);
#define make_atomic_store(S) \
extern void my_atomic_store ## S(int ## S volatile *a, int ## S v);
-#endif
+#endif /* HAVE_INLINE */
make_atomic_cas( 8)
make_atomic_cas(16)
@@ -129,6 +137,8 @@ make_atomic_swap(ptr)
#undef make_atomic_swap_body
#undef intptr
+#endif /* MY_ATOMICS_MADE */
+
#ifdef _atomic_h_cleanup_
#include _atomic_h_cleanup_
#undef _atomic_h_cleanup_