aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-10-07 17:18:50 -0700
committerChris Robinson <[email protected]>2018-10-07 17:18:50 -0700
commit7a79f09a31dc8858769f5c43231e488cb972d340 (patch)
tree73bd3b273bfbdefc2e494c7e6ab5d7d4f5aa255c
parentdb65113c5fceb1996b71b405cce8fbea6f802e60 (diff)
Add a comment about waiting to kill the event thread
-rw-r--r--Alc/ALc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 6e10897b..8bf2e1da 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2809,6 +2809,11 @@ static bool ReleaseContext(ALCcontext *context, ALCdevice *device)
ret = !!newhead;
V0(device->Backend,unlock)();
+ /* Make sure the context is finished and no longer processing in the mixer
+ * before sending the message queue kill event. The backend's lock does
+ * this, although waiting for a non-odd mix count would work too.
+ */
+
while(ll_ringbuffer_write(context->AsyncEvents, (const char*)&kill_evt, 1) == 0)
althrd_yield();
alsem_post(&context->EventSem);