forked from pool/pulseaudio
26 lines
864 B
Diff
26 lines
864 B
Diff
From 9c09d6b31b291d194f97f78a437e9717e8ebf228 Mon Sep 17 00:00:00 2001
|
|
From: Lennart Poettering <lennart@poettering.net>
|
|
Date: Tue, 21 Apr 2009 21:24:33 +0200
|
|
Subject: [PATCH] mutex: when we fail to fill in mutex into static mutex ptr free it again
|
|
|
|
---
|
|
src/pulsecore/mutex-posix.c | 2 ++
|
|
1 files changed, 2 insertions(+), 0 deletions(-)
|
|
|
|
diff --git a/src/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c
|
|
index b3e5256..0ff4bee 100644
|
|
--- a/src/pulsecore/mutex-posix.c
|
|
+++ b/src/pulsecore/mutex-posix.c
|
|
@@ -153,6 +153,8 @@ pa_mutex* pa_static_mutex_get(pa_static_mutex *s, pa_bool_t recursive, pa_bool_t
|
|
if ((pa_atomic_ptr_cmpxchg(&s->ptr, NULL, m)))
|
|
return m;
|
|
|
|
+ pa_mutex_free(m);
|
|
+
|
|
/* Him, filling in failed, so someone else must have filled in
|
|
* already */
|
|
pa_assert_se(m = pa_atomic_ptr_load(&s->ptr));
|
|
--
|
|
1.6.0.2
|
|
|