From: Pino Toscano Date: Mon, 14 Nov 2011 10:58:25 +0000 (+0100) Subject: mutex: handle gracefully if a PTHREAD_PRIO_INHERIT protocol cannot be set X-Git-Tag: 1.0_branch~145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a92327c27a5a321fd15274fb5b1b180e5417a74;p=profile%2Fivi%2Fpulseaudio.git 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 --- diff --git a/src/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c index 634087d..d90525b 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);