aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-09 03:49:40 -0700
committerChris Robinson <[email protected]>2014-03-09 03:49:40 -0700
commit308d87b12aa2b8018be9023c89ad09fcf01d99d1 (patch)
tree18db474b86f611e38f4b2a70d34186c3f04ae23f /Alc/ALc.c
parent372f3178f8cf1d297d88a3c39a5e2b3c78903e86 (diff)
Return the original value from CompExchange*
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 2cda35dc..ffd572e3 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2187,14 +2187,14 @@ static void ReleaseContext(ALCcontext *context, ALCdevice *device)
ALCcontext_DecRef(context);
}
- if(CompExchangePtr((XchgPtr*)&GlobalContext, context, NULL))
+ if(CompExchangePtr((XchgPtr*)&GlobalContext, context, NULL) == context)
ALCcontext_DecRef(context);
ALCdevice_Lock(device);
tmp_ctx = &device->ContextList;
while(*tmp_ctx)
{
- if(CompExchangePtr((XchgPtr*)tmp_ctx, context, context->next))
+ if(CompExchangePtr((XchgPtr*)tmp_ctx, context, context->next) == context)
break;
tmp_ctx = &(*tmp_ctx)->next;
}
@@ -2903,7 +2903,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
do {
ALContext->next = device->ContextList;
- } while(!CompExchangePtr((XchgPtr*)&device->ContextList, ALContext->next, ALContext));
+ } while(CompExchangePtr((XchgPtr*)&device->ContextList, ALContext->next, ALContext) != ALContext->next);
UnlockLists();
ALCdevice_DecRef(device);
@@ -3284,7 +3284,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
do {
device->next = DeviceList;
- } while(!CompExchangePtr((XchgPtr*)&DeviceList, device->next, device));
+ } while(CompExchangePtr((XchgPtr*)&DeviceList, device->next, device) != device->next);
TRACE("Created device %p, \"%s\"\n", device, device->DeviceName);
return device;
@@ -3415,7 +3415,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
do {
device->next = DeviceList;
- } while(!CompExchangePtr((XchgPtr*)&DeviceList, device->next, device));
+ } while(CompExchangePtr((XchgPtr*)&DeviceList, device->next, device) != device->next);
TRACE("Created device %p, \"%s\"\n", device, device->DeviceName);
return device;
@@ -3598,7 +3598,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
V(device->Backend,open)("Loopback");
do {
device->next = DeviceList;
- } while(!CompExchangePtr((XchgPtr*)&DeviceList, device->next, device));
+ } while(CompExchangePtr((XchgPtr*)&DeviceList, device->next, device) != device->next);
TRACE("Created device %p\n", device);
return device;