mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
MDEV-14374 - UT_DELAY code : Removing hardware barrier for arm64 bit platform
UT_RELAX_CPU() is supposed to waste a few CPU cycles, there's no need to load other system components.
This commit is contained in:
parent
a489d91993
commit
12c977ca7b
1 changed files with 10 additions and 5 deletions
|
@ -45,6 +45,7 @@ Created 1/20/1994 Heikki Tuuri
|
|||
#include <stdarg.h>
|
||||
|
||||
#include <string>
|
||||
#include <my_atomic.h>
|
||||
|
||||
/** Index name prefix in fast index creation, as a string constant */
|
||||
#define TEMP_INDEX_PREFIX_STR "\377"
|
||||
|
@ -74,11 +75,15 @@ typedef time_t ib_time_t;
|
|||
# include <sys/platform/ppc.h>
|
||||
# define UT_RELAX_CPU() __ppc_get_timebase()
|
||||
#else
|
||||
# define UT_RELAX_CPU() do { \
|
||||
volatile int32 volatile_var; \
|
||||
int32 oldval= 0; \
|
||||
my_atomic_cas32(&volatile_var, &oldval, 1); \
|
||||
} while (0)
|
||||
static inline void UT_RELAX_CPU(void)
|
||||
{
|
||||
volatile int32 var;
|
||||
int32 oldval = 0;
|
||||
my_atomic_cas32_strong_explicit(
|
||||
&var, &oldval, 1,
|
||||
MY_MEMORY_ORDER_RELAXED,
|
||||
MY_MEMORY_ORDER_RELAXED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (__GNUC__)
|
||||
|
|
Loading…
Add table
Reference in a new issue