From 972289f356102d22a23aac4a93fe42de845dd917 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 29 Aug 2020 01:15:20 +0300 Subject: Detect existence of pthread_mutexattr_setprotocol() Fixes: #1084 --- evthread_pthread.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'evthread_pthread.c') diff --git a/evthread_pthread.c b/evthread_pthread.c index a40f5b02..94e7da95 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -190,11 +190,15 @@ evthread_use_pthreads_with_flags(int flags) return -1; if (flags & EVTHREAD_PTHREAD_PRIO_INHERIT) { +#ifdef EVENT__HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL /* Set up priority inheritance */ if (pthread_mutexattr_setprotocol(&attr_default, PTHREAD_PRIO_INHERIT)) return -1; if (pthread_mutexattr_setprotocol(&attr_recursive, PTHREAD_PRIO_INHERIT)) return -1; +#else + return -1; +#endif } evthread_set_lock_callbacks(&cbs); -- cgit v1.2.1