Recently I want to test MariaDB 10.1.9 on Linux on Power8.
ib_mutex_test_and_set(
/*==================*/
ib_mutex_t* mutex) /*!< in: mutex */
{
#if defined(HAVE_ATOMIC_BUILTINS)
return(os_atomic_test_and_set(&mutex->lock_word));
#else
storage/innobase/include/os0sync.h
#if defined(__powerpc__) || defined(__aarch64__)
/*
os_atomic_test_and_set_byte_release() should imply a release barrier before
setting, and a full barrier after. But __sync_lock_test_and_set() is only
documented as an aquire barrier. So on PowerPC we need to add the full
barrier explicitly. */
# define os_atomic_test_and_set_byte_release(ptr, new_val) \
do { __sync_lock_release(ptr); \
__sync_synchronize(); } while (0)
#else
Only HAVE_IB_GCC_ATOMIC_TEST_AND_SET or IB_STRONG_MEMORY_MODEL will enable codes about os_atomic_test_and_set() and os_atomic_clear().
But on my Power8 environment, HAVE_ATOMIC_BUILTINS is defined, HAVE_IB_GCC_ATOMIC_TEST_AND_SET and IB_STRONG_MEMORY_MODEL are not defined.
So in sync0sync.ic, os_atomic_test_and_set() is used, but in os0sync.h, os_atomic_test_and_set() is not defined.
Does anybody know how to solve this problem?
I'm not familiar with Power.
Thanks,
Lixun
--