aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/jack.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/jack.c')
-rw-r--r--Alc/backends/jack.c6
1 files changed, 5 insertions, 1 deletions
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);