--- a/include/tscore/ink_rwlock.h +++ b/include/tscore/ink_rwlock.h @@ -40,7 +40,7 @@ // Instead of calling ink_rwlock_init(), an ink_rwlock instance can be initialized with one of thsee values. // ink_rwlock const INK_RWLOCK_INIT = PTHREAD_RWLOCK_INITIALIZER; -#if defined(linux) +#if defined(linux) && defined(__GLIBC__) ink_rwlock const INK_RWLOCK_INIT_NO_WRITER_STARVATION = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP; #else // Testing indicates that for MacOS/Darwin and FreeBSD, pthread rwlocks always prevent writer starvation. --- a/include/tscpp/util/TsSharedMutex.h +++ b/include/tscpp/util/TsSharedMutex.h @@ -207,7 +207,7 @@ } } -#if defined(linux) +#if defined(linux) && defined(__GLIBC__) // Use the initializer that prevents writer starvation. // pthread_rwlock_t _lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;