aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-02-04 19:19:43 -0800
committerChris Robinson <[email protected]>2015-02-04 23:39:51 -0800
commit61743a3a0017c567ee62ab50c3da28a5ed2fed8d (patch)
tree8f928cd0b98695c43921a89efd38e2ca141be9a6 /Alc/ALc.c
parentefb7b11d7f60d7fe6b1c10c21b4790f5a1dcd728 (diff)
Avoid unnecessary uses of ExchangeInt/Ptr
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index bb865542..a9f71032 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1599,11 +1599,14 @@ void ALCcontext_DeferUpdates(ALCcontext *context)
SetMixerFPUMode(&oldMode);
V0(device->Backend,lock)();
- if(!ExchangeInt(&context->DeferUpdates, AL_TRUE))
+ if(!context->DeferUpdates)
{
ALboolean UpdateSources;
ALvoice *voice, *voice_end;
ALeffectslot **slot, **slot_end;
+
+ context->DeferUpdates = AL_TRUE;
+
/* Make sure all pending updates are performed */
UpdateSources = ATOMIC_EXCHANGE(ALenum, &context->UpdateSources, AL_FALSE);
@@ -1649,10 +1652,12 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
ALCdevice *device = context->Device;
V0(device->Backend,lock)();
- if(ExchangeInt(&context->DeferUpdates, AL_FALSE))
+ if(context->DeferUpdates)
{
ALsizei pos;
+ context->DeferUpdates = AL_FALSE;
+
LockUIntMapRead(&context->SourceMap);
for(pos = 0;pos < context->SourceMap.size;pos++)
{
@@ -1667,7 +1672,8 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
ReadUnlock(&Source->queue_lock);
}
- new_state = ExchangeInt(&Source->new_state, AL_NONE);
+ new_state = Source->new_state;
+ Source->new_state = AL_NONE;
if(new_state)
SetSourceState(Source, context, new_state);
}