diff options
author | Chris Robinson <[email protected]> | 2017-04-19 19:54:17 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-04-19 19:54:17 -0700 |
commit | 5dcbb8db38bb9aa88d3be45cf84f2e7d993acdd0 (patch) | |
tree | f7e59a298568b62849eda41c00f52335d0296191 /Alc | |
parent | fbb5295f13711f978a1ad5a8abfc6c6d3970df0c (diff) |
Make the buffer list next pointer atomic
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 2 | ||||
-rw-r--r-- | Alc/mixer.c | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -1301,7 +1301,7 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, ALboolean forc CalcNonAttnSourceParams(voice, voice->Props, buffer, context); break; } - BufferListItem = BufferListItem->next; + BufferListItem = ATOMIC_LOAD(&BufferListItem->next, almemory_order_acquire); } } diff --git a/Alc/mixer.c b/Alc/mixer.c index 8996499d..a2a56dbc 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -414,7 +414,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei SrcDataSize += DataSize; } } - tmpiter = tmpiter->next; + tmpiter = ATOMIC_LOAD(&tmpiter->next, almemory_order_acquire); if(!tmpiter && BufferLoopItem) tmpiter = BufferLoopItem; else if(!tmpiter) @@ -612,9 +612,11 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei if(DataSize > DataPosInt) break; - if(!(BufferListItem=BufferListItem->next)) + BufferListItem = ATOMIC_LOAD(&BufferListItem->next, almemory_order_acquire); + if(!BufferListItem) { - if(!(BufferListItem=BufferLoopItem)) + BufferListItem = BufferLoopItem; + if(!BufferListItem) { isplaying = false; DataPosInt = 0; |