summaryrefslogtreecommitdiff
path: root/storage/innobase/include/os0sync.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/os0sync.h')
-rw-r--r--storage/innobase/include/os0sync.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h
index 32fd27960f3..3bd85ac460e 100644
--- a/storage/innobase/include/os0sync.h
+++ b/storage/innobase/include/os0sync.h
@@ -310,6 +310,9 @@ Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, new_val) \
__sync_lock_test_and_set(ptr, (byte) new_val)
+# define os_atomic_lock_release_byte(ptr) \
+ __sync_lock_release(ptr)
+
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
#define HAVE_ATOMIC_BUILTINS
@@ -363,6 +366,9 @@ Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, new_val) \
atomic_swap_uchar(ptr, new_val)
+# define os_atomic_lock_release_byte(ptr) \
+ (void) atomic_swap_uchar(ptr, 0)
+
#elif defined(HAVE_WINDOWS_ATOMICS)
#define HAVE_ATOMIC_BUILTINS
@@ -456,6 +462,9 @@ clobbered */
# define IB_MEMORY_BARRIER_STARTUP_MSG \
"_mm_lfence() and _mm_sfence() are used for memory barrier"
+# define os_atomic_lock_release_byte(ptr) \
+ (void) InterlockedExchange(ptr, 0)
+
#else
# define os_rmb do { } while(0)
# define os_wmb do { } while(0)