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/solaris.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Alc/backends/solaris.c') diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c index fdc62562..f1c4aeaa 100644 --- a/Alc/backends/solaris.c +++ b/Alc/backends/solaris.c @@ -120,7 +120,8 @@ static int ALCsolarisBackend_mixerProc(void *ptr) frame_size = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->AmbiOrder); ALCsolarisBackend_lock(self); - while(!ATOMIC_LOAD_SEQ(&self->killNow) && device->Connected) + while(!ATOMIC_LOAD(&self->killNow, almemory_order_acquire) && + ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) { FD_ZERO(&wfds); FD_SET(self->fd, &wfds); -- cgit v1.2.3