aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alError.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-28 16:58:41 -0800
committerChris Robinson <[email protected]>2018-01-28 16:58:41 -0800
commitc2710ffe87dae7d292e77ed9663783e9d5c227dc (patch)
tree87b273d1b4bd077426670b056402185144e535b8 /OpenAL32/alError.c
parent782eb650c73fe01d1008a2a1bb9da56b65211eff (diff)
Make EnabledEvts atomic
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);