From 15a58eb38375247b6c57a7ceab5aa74895d638cd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 31 Jul 2014 07:20:36 -0700 Subject: Make the source's buffer queue head and current queue item atomic --- Alc/ALu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index 81d062d8..e33a756b 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -260,7 +260,7 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext) /* Calculate the stepping value */ Channels = FmtMono; - BufferListItem = ALSource->queue; + BufferListItem = ATOMIC_LOAD(&ALSource->queue); while(BufferListItem != NULL) { ALbuffer *ALBuffer; @@ -872,7 +872,7 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext) clampf(SpeedOfSound-VSS, 1.0f, SpeedOfSound*2.0f - 1.0f); } - BufferListItem = ALSource->queue; + BufferListItem = ATOMIC_LOAD(&ALSource->queue); while(BufferListItem != NULL) { ALbuffer *ALBuffer; @@ -1308,7 +1308,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device) if(source->state == AL_PLAYING) { source->state = AL_STOPPED; - source->current_buffer = NULL; + ATOMIC_STORE(&source->current_buffer, NULL); source->position = 0; source->position_fraction = 0; } -- cgit v1.2.3