diff options
author | Chris Robinson <[email protected]> | 2018-11-19 03:21:58 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-19 03:21:58 -0800 |
commit | e24435ef58b2f28555e6397f502f41f36524dac9 (patch) | |
tree | 5b828032fff7d64a2d613a40e7dac09cc5c05840 /OpenAL32/alSource.cpp | |
parent | c5142530d675885415c9168869eb6c125ce10876 (diff) |
Remove the atomic exchange macros
Diffstat (limited to 'OpenAL32/alSource.cpp')
-rw-r--r-- | OpenAL32/alSource.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index ac220a2e..ea83d578 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -2488,9 +2488,9 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) if(vidx == -1) vidx = context->VoiceCount++; voice = context->Voices[vidx]; - ATOMIC_STORE(&voice->Playing, false, almemory_order_release); + voice->Playing.store(false, std::memory_order_release); - ATOMIC_EXCHANGE(&source->PropsClean, AL_TRUE, almemory_order_acquire); + source->PropsClean.exchange(AL_TRUE, std::memory_order_acquire); UpdateSourceProps(source, voice, device->NumAuxSends, context); /* A source that's not playing or paused has any offset applied when it @@ -3157,7 +3157,7 @@ static void UpdateSourceProps(ALsource *source, ALvoice *voice, ALsizei num_send ALsizei i; /* Get an unused property container, or allocate a new one as needed. */ - props = ATOMIC_LOAD(&context->FreeVoiceProps, almemory_order_acquire); + props = context->FreeVoiceProps.load(std::memory_order_acquire); if(!props) props = static_cast<ALvoiceProps*>(al_calloc(16, FAM_SIZE(struct ALvoiceProps, Send, num_sends))); @@ -3165,9 +3165,9 @@ static void UpdateSourceProps(ALsource *source, ALvoice *voice, ALsizei num_send { struct ALvoiceProps *next; do { - next = ATOMIC_LOAD(&props->next, almemory_order_relaxed); - } while(ATOMIC_COMPARE_EXCHANGE_WEAK(&context->FreeVoiceProps, &props, next, - almemory_order_acq_rel, almemory_order_acquire) == 0); + next = props->next.load(std::memory_order_relaxed); + } while(context->FreeVoiceProps.compare_exchange_weak(props, next, + std::memory_order_acq_rel, std::memory_order_acquire) == 0); } /* Copy in current property values. */ @@ -3230,7 +3230,7 @@ static void UpdateSourceProps(ALsource *source, ALvoice *voice, ALsizei num_send } /* Set the new container for updating internal parameters. */ - props = ATOMIC_EXCHANGE(&voice->Update, props, almemory_order_acq_rel); + props = voice->Update.exchange(props, std::memory_order_acq_rel); if(props) { /* If there was an unused update container, put it back in the @@ -3249,7 +3249,7 @@ void UpdateAllSourceProps(ALCcontext *context) { ALvoice *voice = context->Voices[pos]; ALsource *source = ATOMIC_LOAD(&voice->Source, almemory_order_acquire); - if(source && !ATOMIC_EXCHANGE(&source->PropsClean, AL_TRUE, almemory_order_acq_rel)) + if(source && !source->PropsClean.exchange(AL_TRUE, std::memory_order_acq_rel)) UpdateSourceProps(source, voice, num_sends, context); } } |