aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-04-19 19:54:17 -0700
committerChris Robinson <[email protected]>2017-04-19 19:54:17 -0700
commit5dcbb8db38bb9aa88d3be45cf84f2e7d993acdd0 (patch)
treef7e59a298568b62849eda41c00f52335d0296191 /Alc
parentfbb5295f13711f978a1ad5a8abfc6c6d3970df0c (diff)
Make the buffer list next pointer atomic
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c2
-rw-r--r--Alc/mixer.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index da3ae9d5..065371d1 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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;