blob: 86412532d0b92cd9de8a90e7e8fde09f9623c605 (
plain) (
tree)
|
|
From d775683f579543c35463ab2a8d9425da10d2f016 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 4 Oct 2017 00:15:30 -0500
Subject: [PATCH] Amend fix for #9 to apply to other Unix systems
At least the musl libc on Linux has the same issue as Mac OS X: the
PTHREAD_RECURSIVE_* static initialiser does not exist. This is a
documented and purposeful omission:
http://www.openwall.com/lists/musl/2017/02/20/3
This commit uses similar logic to the Apple test on other Unixes.
---
src/actions.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index fe14de4..aa15ec7 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -2051,7 +2051,11 @@ namespace {
static pthread_mutex_t cs = PTHREAD_MUTEX_INITIALIZER;
#endif
#else
- static pthread_mutex_t cs = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+ #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+ static pthread_mutex_t cs = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+ #else
+ static pthread_mutex_t cs = PTHREAD_MUTEX_INITIALIZER;
+ #endif
#endif
#endif
--
2.10.0
|