From d5f5d6579a498fd923024b14bd66e1ca9a7aa347 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Thu, 21 Jan 2021 08:33:55 -0800 Subject: [PATCH] Fix compilation against musl lib C (#7875) Summary: See https://github.com/percona/PerconaFT/pull/450 Pull Request resolved: https://github.com/facebook/rocksdb/pull/7875 Reviewed By: ajkr Differential Revision: D25938020 Pulled By: jay-zhuang fbshipit-source-id: 9014dbc7b23bf92c5e63bfbdda4565bb0d2f2b58 --- .../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 bd1cc8e6c..571b950e1 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 \ { \