aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-31 20:21:54 -0800
committerChris Robinson <[email protected]>2018-01-31 20:21:54 -0800
commit7256bc92fa954b6ff313f30694a27b7f47c1589d (patch)
tree7faf7ad76b9e8766c89936d850e1a3df915b6880 /OpenAL32/Include
parent0394d5a44fd5b1c90c7e4ae9d660bec8a19175f1 (diff)
Add a thread to marshal events from the mixer
To avoid having unknown user code running in the mixer thread that could significantly delay the mixed output, a lockless ringbuffer is used for the mixer to provide events that a secondary thread will pop off and process.
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 6ad67b7b..e7a95eef 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -158,6 +158,7 @@ static const union {
extern "C" {
#endif
+struct ll_ringbuffer;
struct Hrtf;
struct HrtfEntry;
struct DirectHrtfState;
@@ -613,6 +614,14 @@ enum {
EventType_Deprecated = 1<<4,
};
+typedef struct AsyncEvent {
+ unsigned int EnumType;
+ ALenum Type;
+ ALuint ObjectId;
+ ALuint Param;
+ ALchar Message[1008];
+} AsyncEvent;
+
struct ALCcontext_struct {
RefCount ref;
@@ -664,8 +673,12 @@ struct ALCcontext_struct {
ATOMIC(struct ALeffectslotArray*) ActiveAuxSlots;
- almtx_t EventCbLock;
+ almtx_t EventThrdLock;
+ althrd_t EventThread;
+ alcnd_t EventCnd;
+ struct ll_ringbuffer *AsyncEvents;
ATOMIC(ALbitfieldSOFT) EnabledEvts;
+ almtx_t EventCbLock;
ALEVENTPROCSOFT EventCb;
void *EventParam;