aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alError.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alError.c')
-rw-r--r--OpenAL32/alError.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c
index e3909742..22aed458 100644
--- a/OpenAL32/alError.c
+++ b/OpenAL32/alError.c
@@ -72,10 +72,12 @@ void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...)
}
ATOMIC_COMPARE_EXCHANGE_STRONG_SEQ(&context->LastError, &curerr, errorCode);
- if((context->EnabledEvts&EventType_Error))
+ if((ATOMIC_LOAD(&context->EnabledEvts, almemory_order_relaxed)&EventType_Error))
{
+ ALbitfieldSOFT enabledevts;
almtx_lock(&context->EventLock);
- if((context->EnabledEvts&EventType_Error) && context->EventCb)
+ 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);