From 179e1c4dbc143c9df50676ce538f628690799cd3 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 3 Mar 2018 21:57:42 -0800 Subject: Don't check for space in the ringbuffer before trying to write The write method already checks and returns how much it managed to fit in. --- Alc/ALc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Alc/ALc.c') diff --git a/Alc/ALc.c b/Alc/ALc.c index ab21c356..0cde449e 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -2749,9 +2749,8 @@ static void FreeContext(ALCcontext *context) if(ATOMIC_EXCHANGE(&context->EnabledEvts, 0, almemory_order_acq_rel)) { static const AsyncEvent kill_evt = { 0 }; - while(ll_ringbuffer_write_space(context->AsyncEvents) == 0) + while(ll_ringbuffer_write(context->AsyncEvents, (const char*)&kill_evt, 1) == 0) althrd_yield(); - ll_ringbuffer_write(context->AsyncEvents, (const char*)&kill_evt, 1); alsem_post(&context->EventSem); althrd_join(context->EventThread, NULL); } -- cgit v1.2.3