Skip to content
Permalink
Browse files
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.
  • Loading branch information
Sergey Vojtovich committed Nov 28, 2017
1 parent a489d91 commit 12c977c
Showing 1 changed file 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__)

0 comments on commit 12c977c

Please sign in to comment.