aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-02-01 18:09:16 -0800
committerChris Robinson <[email protected]>2018-02-01 18:20:14 -0800
commite240351d81105e233f02d006f6bf42d03c0dd09b (patch)
treecfa0d4b2f59bae0ed1ba44a220ba0a9ecdb8f97b /OpenAL32/Include/alMain.h
parent4ec31291c0de9334f6715edc13bf2d28ea884eb0 (diff)
Use a semaphore to signal the event handler
Semaphores allow for semi-persistent signals, compared to a condition variable which requires a mutex for proper detection. A semaphore can be 'post'ed after writing some data on one thread, and another thread will be able to recognize it quickly even if the post occured in between checking for data and waiting. This more correctly fixes a race condition with events since the mixer shouldn't be using mutexes, and arbitrary wake-ups just to make sure an event wasn't missed was quite inefficient.
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index e7a95eef..bc5a27c8 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -675,7 +675,7 @@ struct ALCcontext_struct {
almtx_t EventThrdLock;
althrd_t EventThread;
- alcnd_t EventCnd;
+ alsem_t EventSem;
struct ll_ringbuffer *AsyncEvents;
ATOMIC(ALbitfieldSOFT) EnabledEvts;
almtx_t EventCbLock;