From f9b6cfeca8df976a0fb3cf1be29d2064d5ae0bdf Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 22 Sep 2012 06:54:02 +0200 Subject: [PATCH] [IOMultiplexer] fixed undefined PTHREAD_MUTEX_RECURSIVE_NP (OSX has PTHREAD_MUTEX_RECURSIVE instead) --- src/IOEngine.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/IOEngine.h b/src/IOEngine.h index f64078e..5f68240 100644 --- a/src/IOEngine.h +++ b/src/IOEngine.h @@ -20,10 +20,15 @@ #ifdef HAVE_PTHREAD_H #include +#ifdef PTHREAD_MUTEX_RECURSIVE_NP +#define PTHREAD_MUTEX_RECURSIVE_VAL PTHREAD_MUTEX_RECURSIVE_NP +#else +#define PTHREAD_MUTEX_RECURSIVE_VAL PTHREAD_MUTEX_RECURSIVE +#endif #define IOTHREAD_MUTEX_INIT(var) { \ pthread_mutexattr_t mutex_attr; \ pthread_mutexattr_init(&mutex_attr);\ - pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE_NP);\ + pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE_VAL);\ pthread_mutex_init(&var, &mutex_attr); \ } #define IOSYNCHRONIZE(var) pthread_mutex_lock(&var) -- 2.20.1