From e6f464892413b3da0df664106b6897f47336b17d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 3 Feb 2015 02:40:22 -0800 Subject: Signal the mixer thread outside of the mutex lock --- Alc/backends/jack.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Alc/backends') diff --git a/Alc/backends/jack.c b/Alc/backends/jack.c index ea99a953..75ced9c4 100644 --- a/Alc/backends/jack.c +++ b/Alc/backends/jack.c @@ -479,9 +479,13 @@ static void ALCjackPlayback_stop(ALCjackPlayback *self) return; self->killNow = 1; + /* Lock the backend to ensure we don't flag the mixer to die and signal the + * mixer to wake up in between it checking the flag and going to sleep and + * wait for a wakeup (potentially leading to it never waking back up to see + * the flag). */ ALCjackPlayback_lock(self); - alcnd_signal(&self->Cond); ALCjackPlayback_unlock(self); + alcnd_signal(&self->Cond); althrd_join(self->thread, &res); jack_deactivate(self->Client); -- cgit v1.2.3