mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
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 ca717643ee
See bug #42715
This commit is contained in:
parent
e2876aeb40
commit
9a92327c27
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue