aboutsummaryrefslogtreecommitdiff
path: root/src/pj_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pj_mutex.c')
-rw-r--r--src/pj_mutex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pj_mutex.c b/src/pj_mutex.c
index 60a8e1aa..8106e54c 100644
--- a/src/pj_mutex.c
+++ b/src/pj_mutex.c
@@ -120,7 +120,11 @@ void pj_acquire_lock()
pthread_mutex_lock( &pj_precreated_lock);
pthread_mutexattr_init(&mutex_attr);
+#ifndef PTHREAD_MUTEX_RECURSIVE
+ pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE_NP);
+#else
pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
+#endif
pthread_mutex_init(&pj_core_lock, &mutex_attr);
pj_core_lock_created = 1;