From 9b878c64f9ec83adc4886db553ca184952ff50b4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 4 Feb 2018 00:01:12 -0800 Subject: Make the Connected state atomic Also don't send the Disconnected event more than once. --- Alc/backends/jack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Alc/backends/jack.c') diff --git a/Alc/backends/jack.c b/Alc/backends/jack.c index 2f17bbf6..e6f4b435 100644 --- a/Alc/backends/jack.c +++ b/Alc/backends/jack.c @@ -312,7 +312,8 @@ static int ALCjackPlayback_mixerProc(void *arg) althrd_setname(althrd_current(), MIXER_THREAD_NAME); ALCjackPlayback_lock(self); - while(!ATOMIC_LOAD(&self->killNow, almemory_order_acquire) && device->Connected) + while(!ATOMIC_LOAD(&self->killNow, almemory_order_acquire) && + ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) { ALuint todo, len1, len2; -- cgit v1.2.3