summaryrefslogtreecommitdiff
path: root/include/my_atomic.h
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2009-10-12 11:00:39 +0200
committerMikael Ronstrom <mikael@mysql.com>2009-10-12 11:00:39 +0200
commitbae553cfcd9ad8b9df8b5305736f6810fbaed43b (patch)
treeb9c258d33b8f1dd330ba73287a648ffbd20488d7 /include/my_atomic.h
parenta4785fc4a2abeb3f8fbc253b78f558540b949482 (diff)
downloadmariadb-git-bae553cfcd9ad8b9df8b5305736f6810fbaed43b.tar.gz
Backported my_atomic from 6.0-codebase and added support for 64-bit atomics to enable removal of LOCK_thread_count from every query, removed LOCK_thread_count from use in dispatch_command and close of query which is used in every query, now uses atomic increments/decrements instead
Diffstat (limited to 'include/my_atomic.h')
-rw-r--r--include/my_atomic.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/my_atomic.h b/include/my_atomic.h
index f62d3e32b42..4170e45fe8c 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -37,7 +37,7 @@
my_atomic_store#(&var, what)
store 'what' in *var
- '#' is substituted by a size suffix - 8, 16, 32, or ptr
+ '#' is substituted by a size suffix - 8, 16, 32, 64, or ptr
(e.g. my_atomic_add8, my_atomic_fas32, my_atomic_casptr).
NOTE This operations are not always atomic, so they always must be
@@ -129,6 +129,7 @@
make_transparent_unions(8)
make_transparent_unions(16)
make_transparent_unions(32)
+make_transparent_unions(64)
make_transparent_unions(ptr)
#undef uintptr
#undef make_transparent_unions
@@ -140,10 +141,12 @@ make_transparent_unions(ptr)
#define U_8 int8
#define U_16 int16
#define U_32 int32
+#define U_64 int64
#define U_ptr intptr
#define Uv_8 int8
#define Uv_16 int16
#define Uv_32 int32
+#define Uv_64 int64
#define Uv_ptr intptr
#define U_a volatile *a
#define U_cmp *cmp
@@ -217,6 +220,7 @@ make_atomic_cas(8)
make_atomic_cas(16)
#endif
make_atomic_cas(32)
+make_atomic_cas(64)
make_atomic_cas(ptr)
#ifdef MY_ATOMIC_HAS_8_16
@@ -224,12 +228,14 @@ make_atomic_add(8)
make_atomic_add(16)
#endif
make_atomic_add(32)
+make_atomic_add(64)
#ifdef MY_ATOMIC_HAS_8_16
make_atomic_load(8)
make_atomic_load(16)
#endif
make_atomic_load(32)
+make_atomic_load(64)
make_atomic_load(ptr)
#ifdef MY_ATOMIC_HAS_8_16
@@ -237,6 +243,7 @@ make_atomic_fas(8)
make_atomic_fas(16)
#endif
make_atomic_fas(32)
+make_atomic_fas(64)
make_atomic_fas(ptr)
#ifdef MY_ATOMIC_HAS_8_16
@@ -244,6 +251,7 @@ make_atomic_store(8)
make_atomic_store(16)
#endif
make_atomic_store(32)
+make_atomic_store(64)
make_atomic_store(ptr)
#ifdef _atomic_h_cleanup_
@@ -254,10 +262,12 @@ make_atomic_store(ptr)
#undef U_8
#undef U_16
#undef U_32
+#undef U_64
#undef U_ptr
#undef Uv_8
#undef Uv_16
#undef Uv_32
+#undef Uv_64
#undef Uv_ptr
#undef a
#undef cmp