Skip to content

Commit

Permalink
Amend fix for #9 to apply to other Unix systems
Browse files Browse the repository at this point in the history
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 d775683
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d775683

Please sign in to comment.