From 1d912921f38f2fb9135c909bb33f81abcb3f79a5 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sat, 16 Jan 2021 22:23:21 +0100 Subject: [PATCH] Fix compilation against musl lib C See https://github.com/percona/PerconaFT/pull/450 --- .../lock/range/range_tree/lib/portability/toku_pthread.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h index bd1cc8e6ce21..571b950e1117 100644 --- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h +++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h @@ -153,7 +153,12 @@ typedef struct toku_mutex_aligned { { .pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr } #endif // defined(TOKU_PTHREAD_DEBUG) #else // __FreeBSD__, __linux__, at least +#if defined(__GLIBC__) #define TOKU_MUTEX_ADAPTIVE PTHREAD_MUTEX_ADAPTIVE_NP +#else +// not all libc (e.g. musl) implement NP (Non-POSIX) attributes +#define TOKU_MUTEX_ADAPTIVE PTHREAD_MUTEX_DEFAULT +#endif #if defined(TOKU_PTHREAD_DEBUG) #define TOKU_ADAPTIVE_MUTEX_INITIALIZER \ { \