Permalink
Browse files

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.
  • Loading branch information...
awilfox committed Oct 4, 2017
1 parent 6db39b0 commit d775683f579543c35463ab2a8d9425da10d2f016
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/actions.cpp
View
@@ -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

0 comments on commit d775683

Please sign in to comment.