summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2011-11-14 11:58:25 +0100
committerArun Raghavan <arun.raghavan@collabora.co.uk>2012-01-03 00:20:04 +0530
commit9a92327c27a5a321fd15274fb5b1b180e5417a74 (patch)
tree6d777a012270189e7b6b52aa365932496e378212
parente2876aeb408429b1363080ad77f45690d22e5794 (diff)
downloadpulseaudio-9a92327c27a5a321fd15274fb5b1b180e5417a74.tar.gz
mutex: handle gracefully if a PTHREAD_PRIO_INHERIT protocol cannot be set
This adds an additional check for unavailable PTHREAD_PRIO_INHERIT to the fallback work done in ca717643ee768307475fc36ea29d920a13db0a8e See bug #42715
-rw-r--r--src/pulsecore/mutex-posix.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c
index 634087d9e..d90525bf3 100644
--- a/src/pulsecore/mutex-posix.c
+++ b/src/pulsecore/mutex-posix.c
@@ -50,8 +50,10 @@ pa_mutex* pa_mutex_new(pa_bool_t recursive, pa_bool_t inherit_priority) {
pa_assert_se(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) == 0);
#ifdef HAVE_PTHREAD_PRIO_INHERIT
- if (inherit_priority)
- pa_assert_se(pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT) == 0);
+ if (inherit_priority) {
+ r = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
+ pa_assert(r == 0 || r == ENOTSUP);
+ }
#endif
m = pa_xnew(pa_mutex, 1);