diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/alError.c | 4 | ||||
-rw-r--r-- | OpenAL32/alState.c | 4 | ||||
-rw-r--r-- | OpenAL32/event.c | 6 |
4 files changed, 7 insertions, 9 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index ef5ad0e9..6ad67b7b 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -664,7 +664,7 @@ struct ALCcontext_struct { ATOMIC(struct ALeffectslotArray*) ActiveAuxSlots; - almtx_t EventLock; + almtx_t EventCbLock; ATOMIC(ALbitfieldSOFT) EnabledEvts; ALEVENTPROCSOFT EventCb; void *EventParam; diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index 22aed458..b6208f77 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -75,12 +75,12 @@ void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...) if((ATOMIC_LOAD(&context->EnabledEvts, almemory_order_relaxed)&EventType_Error)) { ALbitfieldSOFT enabledevts; - almtx_lock(&context->EventLock); + almtx_lock(&context->EventCbLock); enabledevts = ATOMIC_LOAD(&context->EnabledEvts, almemory_order_relaxed); if((enabledevts&EventType_Error) && context->EventCb) (*context->EventCb)(AL_EVENT_TYPE_ERROR_SOFT, 0, errorCode, msglen, msg, context->EventParam); - almtx_unlock(&context->EventLock); + almtx_unlock(&context->EventCbLock); } } diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 10fce3b5..8448e548 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -722,12 +722,12 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value) "alDopplerVelocity is deprecated in AL1.1, use alSpeedOfSound"; const ALsizei msglen = (ALsizei)strlen(msg); ALbitfieldSOFT enabledevts; - almtx_lock(&context->EventLock); + almtx_lock(&context->EventCbLock); enabledevts = ATOMIC_LOAD(&context->EnabledEvts, almemory_order_relaxed); if((enabledevts&EventType_Deprecated) && context->EventCb) (*context->EventCb)(AL_EVENT_TYPE_DEPRECATED_SOFT, 0, 0, msglen, msg, context->EventParam); - almtx_unlock(&context->EventLock); + almtx_unlock(&context->EventCbLock); } if(!(value >= 0.0f && isfinite(value))) diff --git a/OpenAL32/event.c b/OpenAL32/event.c index 93d68d7a..9a3a92b4 100644 --- a/OpenAL32/event.c +++ b/OpenAL32/event.c @@ -37,7 +37,6 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A SETERR_GOTO(context, AL_INVALID_ENUM, done, "Invalid event type 0x%04x", types[i]); } - almtx_lock(&context->EventLock); if(enable) { ALbitfieldSOFT enabledevts = ATOMIC_LOAD(&context->EnabledEvts, almemory_order_relaxed); @@ -57,7 +56,6 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A { } } - almtx_unlock(&context->EventLock); done: ALCcontext_DecRef(context); @@ -70,10 +68,10 @@ AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *user context = GetContextRef(); if(!context) return; - almtx_lock(&context->EventLock); + almtx_lock(&context->EventCbLock); context->EventCb = callback; context->EventParam = userParam; - almtx_unlock(&context->EventLock); + almtx_unlock(&context->EventCbLock); ALCcontext_DecRef(context); } |