From 1d2504d12e996a4c1e8fe9785901db9a9e3b4d7c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 14 May 2014 02:47:07 -0700 Subject: Make RefCount a non-integer type It should only be accessed through the appropriate functions to ensure proper atomicity. --- OpenAL32/alSource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenAL32/alSource.c') diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 167208e5..78ccef9a 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2230,16 +2230,16 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers(ALuint src, ALsizei nb, ALuint if(BufferList) { ALCdevice *device = context->Device; - RefCount count; + uint count; /* Cut the new head's link back to the old body. The mixer is robust * enough to handle the link back going away. Once the active mix (if * any) is complete, it's safe to finish cutting the old tail from the * new head. */ BufferList = ExchangePtr((XchgPtr*)&BufferList->prev, NULL); - if(((count=device->MixCount)&1) != 0) + if(((count=ReadRef(&device->MixCount))&1) != 0) { - while(count == device->MixCount) + while(count == ReadRef(&device->MixCount)) althrd_yield(); } BufferList->next = NULL; -- cgit v1.2.3