mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
mutex-posix: Log pthread_mutex_unlock() error
This call has been seen failing on FreeBSD, and it's difficult to debug without seeing which error the function returned. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/988
This commit is contained in:
parent
093dd2f181
commit
757eb26448
1 changed files with 8 additions and 1 deletions
|
|
@ -25,6 +25,8 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <pulse/xmalloc.h>
|
||||
|
||||
#include <pulsecore/core-error.h>
|
||||
#include <pulsecore/macro.h>
|
||||
|
||||
#include "mutex.h"
|
||||
|
|
@ -103,9 +105,14 @@ bool pa_mutex_try_lock(pa_mutex *m) {
|
|||
}
|
||||
|
||||
void pa_mutex_unlock(pa_mutex *m) {
|
||||
int err;
|
||||
|
||||
pa_assert(m);
|
||||
|
||||
pa_assert_se(pthread_mutex_unlock(&m->mutex) == 0);
|
||||
if ((err = pthread_mutex_unlock(&m->mutex) != 0)) {
|
||||
pa_log("pthread_mutex_unlock() failed: %s", pa_cstrerror(err));
|
||||
pa_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
pa_cond *pa_cond_new(void) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue