diff options
author | Chris Robinson <[email protected]> | 2014-07-21 23:14:48 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-22 00:20:28 -0700 |
commit | 5a339a2a5b12545c105a2a3dcfb1d8e466b0381f (patch) | |
tree | 95dab694ebe14d41e3e775dc651d07ee26cbe44a /OpenAL32/alState.c | |
parent | 7b41ed7ec4bfb7e8ac3daef3eebc6831b96a8fa4 (diff) |
Add macros for generic atomic functionality
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index d499fcd1..59619b0d 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -56,7 +56,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability) { case AL_SOURCE_DISTANCE_MODEL: context->SourceDistanceModel = AL_TRUE; - context->UpdateSources = AL_TRUE; + ATOMIC_STORE(context->UpdateSources, AL_TRUE); break; default: @@ -78,7 +78,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability) { case AL_SOURCE_DISTANCE_MODEL: context->SourceDistanceModel = AL_FALSE; - context->UpdateSources = AL_TRUE; + ATOMIC_STORE(context->UpdateSources, AL_TRUE); break; default: @@ -643,7 +643,7 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value) SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); context->DopplerFactor = value; - context->UpdateSources = AL_TRUE; + ATOMIC_STORE(context->UpdateSources, AL_TRUE); done: ALCcontext_DecRef(context); @@ -660,7 +660,7 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value) SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); context->DopplerVelocity = value; - context->UpdateSources = AL_TRUE; + ATOMIC_STORE(context->UpdateSources, AL_TRUE); done: ALCcontext_DecRef(context); @@ -677,7 +677,7 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat value) SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); context->SpeedOfSound = value; - context->UpdateSources = AL_TRUE; + ATOMIC_STORE(context->UpdateSources, AL_TRUE); done: ALCcontext_DecRef(context); @@ -698,7 +698,7 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value) context->DistanceModel = value; if(!context->SourceDistanceModel) - context->UpdateSources = AL_TRUE; + ATOMIC_STORE(context->UpdateSources, AL_TRUE); done: ALCcontext_DecRef(context); @@ -725,7 +725,7 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) context->DeferUpdates = AL_TRUE; /* Make sure all pending updates are performed */ - UpdateSources = ExchangeInt(&context->UpdateSources, AL_FALSE); + UpdateSources = ATOMIC_EXCHANGE(ALenum, context->UpdateSources, AL_FALSE); src = context->ActiveSources; src_end = src + context->ActiveSourceCount; @@ -742,7 +742,7 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) continue; } - if(ExchangeInt(&source->NeedsUpdate, AL_FALSE) || UpdateSources) + if(ATOMIC_EXCHANGE(ALenum, source->NeedsUpdate, AL_FALSE) || UpdateSources) (*src)->Update(*src, context); src++; |