diff options
author | Chris Robinson <[email protected]> | 2016-11-21 21:38:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-11-21 21:38:49 -0800 |
commit | 8bf4fe2eea11afd753e25dd495c26e6522436b5f (patch) | |
tree | 484e799039b43837a947667140dfc3c32e3e1c11 | |
parent | a502a41be340826585f9c91b3a8d9a52b5601b54 (diff) |
Update some atomic memory ordering
-rw-r--r-- | Alc/ALu.c | 15 | ||||
-rw-r--r-- | Alc/mixer.c | 4 |
2 files changed, 11 insertions, 8 deletions
@@ -293,11 +293,12 @@ static ALboolean CalcListenerParams(ALCcontext *Context) * in the old container (practically impossible with this little code, * but...). */ - first = ATOMIC_LOAD(&Listener->FreeList); + first = ATOMIC_LOAD(&Listener->FreeList, almemory_order_acquire); do { ATOMIC_STORE(&props->next, first, almemory_order_relaxed); } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALlistenerProps*, - &Listener->FreeList, &first, props) == 0); + &Listener->FreeList, &first, props, almemory_order_acq_rel, + almemory_order_acquire) == 0); return AL_TRUE; } @@ -341,11 +342,12 @@ static ALboolean CalcEffectSlotParams(ALeffectslot *slot, ALCdevice *device) * in the old container (practically impossible with this little code, * but...). */ - first = ATOMIC_LOAD(&slot->FreeList); + first = ATOMIC_LOAD(&slot->FreeList, almemory_order_acquire); do { ATOMIC_STORE(&props->next, first, almemory_order_relaxed); } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALeffectslotProps*, - &slot->FreeList, &first, props) == 0); + &slot->FreeList, &first, props, almemory_order_acq_rel, + almemory_order_acquire) == 0); return AL_TRUE; } @@ -1314,11 +1316,12 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, ALboolean forc * actually swap in the old container (practically impossible with this * little code, but...). */ - first = ATOMIC_LOAD(&source->FreeList); + first = ATOMIC_LOAD(&source->FreeList, almemory_order_acquire); do { ATOMIC_STORE(&props->next, first, almemory_order_relaxed); } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALsourceProps*, - &source->FreeList, &first, props) == 0); + &source->FreeList, &first, props, almemory_order_acq_rel, + almemory_order_acquire) == 0); } BufferListItem = ATOMIC_LOAD(&source->queue, almemory_order_relaxed); diff --git a/Alc/mixer.c b/Alc/mixer.c index 727d0640..dba429a0 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -399,7 +399,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam /* Get source info */ State = AL_PLAYING; /* Only called while playing. */ - BufferListItem = ATOMIC_LOAD(&Source->current_buffer); + BufferListItem = ATOMIC_LOAD(&Source->current_buffer, almemory_order_acquire); DataPosInt = ATOMIC_LOAD(&Source->position, almemory_order_relaxed); DataPosFrac = ATOMIC_LOAD(&Source->position_fraction, almemory_order_relaxed); Looping = ATOMIC_LOAD(&Source->looping, almemory_order_relaxed); @@ -696,5 +696,5 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam Source->state = State; ATOMIC_STORE(&Source->current_buffer, BufferListItem, almemory_order_relaxed); ATOMIC_STORE(&Source->position, DataPosInt, almemory_order_relaxed); - ATOMIC_STORE(&Source->position_fraction, DataPosFrac); + ATOMIC_STORE(&Source->position_fraction, DataPosFrac, almemory_order_release); } |