diff options
author | Azat Khuzhin <azat@libevent.org> | 2020-08-29 01:15:20 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2020-08-29 01:15:20 +0300 |
commit | 972289f356102d22a23aac4a93fe42de845dd917 (patch) | |
tree | 5f5e1df6285826beacde24c2eb2a983b33137385 /evthread_pthread.c | |
parent | e3e7bb212ea17aa8a9d5a30163487342e6ebb350 (diff) | |
download | libevent-972289f356102d22a23aac4a93fe42de845dd917.tar.gz |
Detect existence of pthread_mutexattr_setprotocol()
Fixes: #1084
Diffstat (limited to 'evthread_pthread.c')
-rw-r--r-- | evthread_pthread.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |