summaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-14 02:47:07 -0700
committerChris Robinson <[email protected]>2014-05-14 02:47:07 -0700
commit1d2504d12e996a4c1e8fe9785901db9a9e3b4d7c (patch)
tree51895ba97192cee1fccab44a838e4fa43d81a984 /Alc/backends
parent4454ae25c753388c529b937ae2ce0f47f06d16c4 (diff)
Make RefCount a non-integer type
It should only be accessed through the appropriate functions to ensure proper atomicity.
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/winmm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index 2f01ffdf..624af37a 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -41,7 +41,7 @@ typedef struct {
volatile ALboolean killNow;
althrd_t thread;
- volatile RefCount WaveBuffersCommitted;
+ RefCount WaveBuffersCommitted;
WAVEHDR WaveBuffer[4];
union {
@@ -194,7 +194,7 @@ FORCE_ALIGN static int PlaybackThreadProc(void *arg)
if(data->killNow)
{
- if(data->WaveBuffersCommitted == 0)
+ if(ReadRef(&data->WaveBuffersCommitted) == 0)
break;
continue;
}
@@ -412,7 +412,7 @@ static ALCboolean WinMMStartPlayback(ALCdevice *device)
if(althrd_create(&data->thread, PlaybackThreadProc, device) != althrd_success)
return ALC_FALSE;
- data->WaveBuffersCommitted = 0;
+ InitRef(&data->WaveBuffersCommitted, 0);
// Create 4 Buffers
BufferSize = device->UpdateSize*device->NumUpdates / 4;
@@ -549,7 +549,7 @@ static ALCenum WinMMOpenCapture(ALCdevice *Device, const ALCchar *deviceName)
if(!data->Ring)
goto failure;
- data->WaveBuffersCommitted = 0;
+ InitRef(&data->WaveBuffersCommitted, 0);
// Create 4 Buffers of 50ms each
BufferSize = data->Format.nAvgBytesPerSec / 20;