File tree Expand file tree Collapse file tree 4 files changed +2
-26
lines changed Expand file tree Collapse file tree 4 files changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,8 @@ struct ut_when_dtor {
88
88
the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
89
89
independent way by using YieldProcessor. */
90
90
# define UT_RELAX_CPU () YieldProcessor()
91
- # elif defined(HAVE_ATOMIC_BUILTINS)
92
- # define UT_RELAX_CPU () do { \
93
- volatile lint volatile_var; \
94
- os_compare_and_swap_lint (&volatile_var, 0 , 1 ); \
95
- } while (0 )
96
91
# else
97
- # define UT_RELAX_CPU () (( void ) 0 ) /* avoid warning for an empty statement */
92
+ # define UT_RELAX_CPU () __asm__ __volatile__ ( " " ::: " memory " )
98
93
# endif
99
94
100
95
/* ********************************************************************/ /* *
Original file line number Diff line number Diff line change @@ -45,9 +45,6 @@ Created 5/11/1994 Heikki Tuuri
45
45
# include < string>
46
46
#endif /* UNIV_HOTBACKUP */
47
47
48
- /* * A constant to prevent the compiler from optimizing ut_delay() away. */
49
- UNIV_INTERN ibool ut_always_false = FALSE ;
50
-
51
48
#ifdef __WIN__
52
49
/* ****************************************************************/ /* *
53
50
NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix
@@ -411,10 +408,6 @@ ut_delay(
411
408
UT_RELAX_CPU ();
412
409
}
413
410
414
- if (ut_always_false) {
415
- ut_always_false = (ibool) j;
416
- }
417
-
418
411
return (j);
419
412
}
420
413
#endif /* !UNIV_HOTBACKUP */
Original file line number Diff line number Diff line change @@ -80,18 +80,13 @@ struct ut_when_dtor {
80
80
81
81
# elif defined(HAVE_FAKE_PAUSE_INSTRUCTION)
82
82
# define UT_RELAX_CPU () __asm__ __volatile__ (" rep; nop" )
83
- # elif defined(HAVE_ATOMIC_BUILTINS)
84
- # define UT_RELAX_CPU () do { \
85
- volatile lint volatile_var; \
86
- os_compare_and_swap_lint (&volatile_var, 0 , 1 ); \
87
- } while (0 )
88
83
# elif defined(HAVE_WINDOWS_ATOMICS)
89
84
/* In the Win32 API, the x86 PAUSE instruction is executed by calling
90
85
the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
91
86
independent way by using YieldProcessor. */
92
87
# define UT_RELAX_CPU () YieldProcessor()
93
88
# else
94
- # define UT_RELAX_CPU () (( void ) 0 ) /* avoid warning for an empty statement */
89
+ # define UT_RELAX_CPU () __asm__ __volatile__ ( " " ::: " memory " )
95
90
# endif
96
91
97
92
/* ********************************************************************/ /* *
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ Created 5/11/1994 Heikki Tuuri
46
46
# include < string>
47
47
#endif /* UNIV_HOTBACKUP */
48
48
49
- /* * A constant to prevent the compiler from optimizing ut_delay() away. */
50
- UNIV_INTERN ibool ut_always_false = FALSE ;
51
-
52
49
#ifdef __WIN__
53
50
/* ****************************************************************/ /* *
54
51
NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix
@@ -412,10 +409,6 @@ ut_delay(
412
409
UT_RELAX_CPU ();
413
410
}
414
411
415
- if (ut_always_false) {
416
- ut_always_false = (ibool) j;
417
- }
418
-
419
412
return (j);
420
413
}
421
414
#endif /* !UNIV_HOTBACKUP */
You can’t perform that action at this time.
0 commit comments