diff options
author | Chris Robinson <[email protected]> | 2018-01-28 16:58:41 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-28 16:58:41 -0800 |
commit | c2710ffe87dae7d292e77ed9663783e9d5c227dc (patch) | |
tree | 87b273d1b4bd077426670b056402185144e535b8 /OpenAL32/alState.c | |
parent | 782eb650c73fe01d1008a2a1bb9da56b65211eff (diff) |
Make EnabledEvts atomic
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index d4f3c6cf..10fce3b5 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -716,13 +716,15 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value) context = GetContextRef(); if(!context) return; - if((context->EnabledEvts&EventType_Deprecated)) + if((ATOMIC_LOAD(&context->EnabledEvts, almemory_order_relaxed)&EventType_Deprecated)) { static const ALCchar msg[] = "alDopplerVelocity is deprecated in AL1.1, use alSpeedOfSound"; const ALsizei msglen = (ALsizei)strlen(msg); + ALbitfieldSOFT enabledevts; almtx_lock(&context->EventLock); - if((context->EnabledEvts&EventType_Deprecated) && context->EventCb) + 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); |