1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-16 20:55:20 +03:00
aports/testing/trafficserver9/fix-pthread.patch
2023-08-26 10:13:04 +00:00

22 lines
870 B
Diff

--- 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;