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.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h
index a39a331c297..5533df4f608 100644
--- a/storage/innobase/include/os0sync.h
+++ b/storage/innobase/include/os0sync.h
@@ -261,6 +261,29 @@ os_fast_mutex_free(
/*===============*/
os_fast_mutex_t* fast_mutex); /* in: mutex to free */
+#ifdef HAVE_GCC_ATOMIC_BUILTINS
+/**************************************************************
+Atomic compare-and-swap for InnoDB. Currently requires GCC atomic builtins. */
+UNIV_INLINE
+ibool
+os_compare_and_swap(
+/*================*/
+ /* out: true if swapped */
+ volatile lint* ptr, /* in: pointer to target */
+ lint oldVal, /* in: value to compare to */
+ lint newVal); /* in: value to swap in */
+/**************************************************************
+Atomic increment for InnoDB. Currently requires GCC atomic builtins. */
+UNIV_INLINE
+lint
+os_atomic_increment(
+/*================*/
+ /* out: resulting value */
+ volatile lint* ptr, /* in: pointer to target */
+ lint amount); /* in: amount of increment */
+
+#endif /* HAVE_GCC_ATOMIC_BUILTINS */
+
#ifndef UNIV_NONINL
#include "os0sync.ic"
#endif