diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index e2635248b03..338cdf115d7 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -88,13 +88,8 @@ private: the YieldProcessor macro defined in WinNT.h. It is a CPU architecture- independent way by using YieldProcessor. */ # define UT_RELAX_CPU() YieldProcessor() -# elif defined(HAVE_ATOMIC_BUILTINS) -# define UT_RELAX_CPU() do { \ - volatile lint volatile_var; \ - os_compare_and_swap_lint(&volatile_var, 0, 1); \ - } while (0) # else -# define UT_RELAX_CPU() ((void)0) /* avoid warning for an empty statement */ +# define UT_RELAX_CPU() __asm__ __volatile__ ("":::"memory") # endif /*********************************************************************//** diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc index a5970c1dc3f..a0fc154ce6b 100644 --- a/storage/innobase/ut/ut0ut.cc +++ b/storage/innobase/ut/ut0ut.cc @@ -45,9 +45,6 @@ Created 5/11/1994 Heikki Tuuri # include #endif /* UNIV_HOTBACKUP */ -/** A constant to prevent the compiler from optimizing ut_delay() away. */ -UNIV_INTERN ibool ut_always_false = FALSE; - #ifdef __WIN__ /*****************************************************************//** NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix @@ -411,10 +408,6 @@ ut_delay( UT_RELAX_CPU(); } - if (ut_always_false) { - ut_always_false = (ibool) j; - } - return(j); } #endif /* !UNIV_HOTBACKUP */ diff --git a/storage/xtradb/include/ut0ut.h b/storage/xtradb/include/ut0ut.h index 9228c25d8be..fbebbc68628 100644 --- a/storage/xtradb/include/ut0ut.h +++ b/storage/xtradb/include/ut0ut.h @@ -80,18 +80,13 @@ private: # elif defined(HAVE_FAKE_PAUSE_INSTRUCTION) # define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop") -# elif defined(HAVE_ATOMIC_BUILTINS) -# define UT_RELAX_CPU() do { \ - volatile lint volatile_var; \ - os_compare_and_swap_lint(&volatile_var, 0, 1); \ - } while (0) # elif defined(HAVE_WINDOWS_ATOMICS) /* In the Win32 API, the x86 PAUSE instruction is executed by calling the YieldProcessor macro defined in WinNT.h. It is a CPU architecture- independent way by using YieldProcessor. */ # define UT_RELAX_CPU() YieldProcessor() # else -# define UT_RELAX_CPU() ((void)0) /* avoid warning for an empty statement */ +# define UT_RELAX_CPU() __asm__ __volatile__ ("":::"memory") # endif /*********************************************************************//** diff --git a/storage/xtradb/ut/ut0ut.cc b/storage/xtradb/ut/ut0ut.cc index 4eade1fe26e..5e85594ef44 100644 --- a/storage/xtradb/ut/ut0ut.cc +++ b/storage/xtradb/ut/ut0ut.cc @@ -46,9 +46,6 @@ Created 5/11/1994 Heikki Tuuri # include #endif /* UNIV_HOTBACKUP */ -/** A constant to prevent the compiler from optimizing ut_delay() away. */ -UNIV_INTERN ibool ut_always_false = FALSE; - #ifdef __WIN__ /*****************************************************************//** NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix @@ -412,10 +409,6 @@ ut_delay( UT_RELAX_CPU(); } - if (ut_always_false) { - ut_always_false = (ibool) j; - } - return(j); } #endif /* !UNIV_HOTBACKUP */