aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alState.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-29 00:50:55 -0700
committerChris Robinson <[email protected]>2011-08-29 00:50:55 -0700
commit58078e2c1eb2a3778462c1d0632b0a2c85fe82ec (patch)
tree434158738f276fd2ef6f1c855fa895044a348822 /OpenAL32/alState.c
parent01503f8a7bd99136445008eba5bed5af483a7aea (diff)
Use atomic exchanges when checking for updates to objects' internal parameters
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r--OpenAL32/alState.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index 8e4c4671..7e73f407 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -604,22 +604,17 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void)
continue;
}
- if((*src)->NeedsUpdate || UpdateSources)
- {
- (*src)->NeedsUpdate = AL_FALSE;
+ if(Exchange_ALenum(&(*src)->NeedsUpdate, AL_FALSE) || UpdateSources)
ALsource_Update(*src, Context);
- }
+
src++;
}
for(e = 0;e < Context->EffectSlotMap.size;e++)
{
ALEffectSlot = Context->EffectSlotMap.array[e].value;
- if(ALEffectSlot->NeedsUpdate)
- {
- ALEffectSlot->NeedsUpdate = AL_FALSE;
+ if(Exchange_ALenum(&ALEffectSlot->NeedsUpdate, AL_FALSE))
ALEffect_Update(ALEffectSlot->EffectState, Context, ALEffectSlot);
- }
}
}