diff options
author | Chris Robinson <[email protected]> | 2015-02-03 02:40:22 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-02-03 02:40:22 -0800 |
commit | e6f464892413b3da0df664106b6897f47336b17d (patch) | |
tree | a00431b7455c17b90cf571658be3a2d308154439 /Alc/backends | |
parent | 12e443d61dd541cde1749b1b65e0de030eda9f86 (diff) |
Signal the mixer thread outside of the mutex lock
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/jack.c | 6 |
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); |