aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
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/ALc.c
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/ALc.c')
-rw-r--r--Alc/ALc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 5114942c..974ba6fa 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2024,14 +2024,14 @@ static ALCvoid FreeDevice(ALCdevice *device)
void ALCdevice_IncRef(ALCdevice *device)
{
- RefCount ref;
+ uint ref;
ref = IncrementRef(&device->ref);
TRACEREF("%p increasing refcount to %u\n", device, ref);
}
void ALCdevice_DecRef(ALCdevice *device)
{
- RefCount ref;
+ uint ref;
ref = DecrementRef(&device->ref);
TRACEREF("%p decreasing refcount to %u\n", device, ref);
if(ref == 0) FreeDevice(device);
@@ -2189,14 +2189,14 @@ static void ReleaseContext(ALCcontext *context, ALCdevice *device)
void ALCcontext_IncRef(ALCcontext *context)
{
- RefCount ref;
+ uint ref;
ref = IncrementRef(&context->ref);
TRACEREF("%p increasing refcount to %u\n", context, ref);
}
void ALCcontext_DecRef(ALCcontext *context)
{
- RefCount ref;
+ uint ref;
ref = DecrementRef(&context->ref);
TRACEREF("%p decreasing refcount to %u\n", context, ref);
if(ref == 0) FreeContext(context);
@@ -2855,7 +2855,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
ALContext = calloc(1, sizeof(ALCcontext)+sizeof(ALlistener));
if(ALContext)
{
- ALContext->ref = 1;
+ InitRef(&ALContext->ref, 1);
ALContext->Listener = (ALlistener*)ALContext->_listener_mem;
VECTOR_INIT(ALContext->ActiveAuxSlots);
@@ -3052,7 +3052,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
}
//Validate device
- device->ref = 1;
+ InitRef(&device->ref, 1);
device->Connected = ALC_TRUE;
device->Type = Playback;
device->LastError = ALC_NO_ERROR;
@@ -3352,7 +3352,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
}
//Validate device
- device->ref = 1;
+ InitRef(&device->ref, 1);
device->Connected = ALC_TRUE;
device->Type = Capture;
@@ -3518,7 +3518,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
}
//Validate device
- device->ref = 1;
+ InitRef(&device->ref, 1);
device->Connected = ALC_TRUE;
device->Type = Loopback;
device->LastError = ALC_NO_ERROR;