aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-03-23 19:16:32 -0700
committerChris Robinson <[email protected]>2017-03-23 19:16:32 -0700
commit1c49d0542d53133c1e023fc22ff5537ea3ca41aa (patch)
tree212c7e8107ec5ea82f700341467b251e4f1a2048 /OpenAL32/alAuxEffectSlot.c
parent5404b2225aca57407f2f3704e2e2616a281d85ae (diff)
Use an atomic flag to mark auxiliary effect slot updates
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r--OpenAL32/alAuxEffectSlot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 37316549..8fc62bde 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -60,7 +60,7 @@ static void ALeffectState_DecRef(ALeffectState *state);
if(!ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire)) \
UpdateEffectSlotProps(slot); \
else \
- slot->NeedsUpdate = AL_TRUE; \
+ ATOMIC_FLAG_CLEAR(&slot->PropsClean, almemory_order_release); \
} while(0)
@@ -579,9 +579,9 @@ ALenum InitEffectSlot(ALeffectslot *slot)
if(!(slot->Effect.State=V0(factory,create)()))
return AL_OUT_OF_MEMORY;
- slot->NeedsUpdate = AL_FALSE;
slot->Gain = 1.0;
slot->AuxSendAuto = AL_TRUE;
+ ATOMIC_FLAG_TEST_AND_SET(&slot->PropsClean, almemory_order_relaxed);
InitRef(&slot->ref, 0);
ATOMIC_INIT(&slot->Update, NULL);
@@ -683,9 +683,8 @@ void UpdateAllEffectSlotProps(ALCcontext *context)
slot = ATOMIC_LOAD_SEQ(&context->ActiveAuxSlotList);
while(slot)
{
- if(slot->NeedsUpdate)
+ if(ATOMIC_FLAG_TEST_AND_SET(&slot->PropsClean, almemory_order_acq_rel))
UpdateEffectSlotProps(slot);
- slot->NeedsUpdate = AL_FALSE;
slot = ATOMIC_LOAD(&slot->next, almemory_order_relaxed);
}
UnlockEffectSlotsRead(context);