aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-23 06:36:34 -0700
committerChris Robinson <[email protected]>2014-07-23 06:36:34 -0700
commita3dbe08c8b9df301dded52ad78f655c2753be56c (patch)
tree69e5d4fd8f3a195bfae430d9a9a5dedf660509f7 /Alc/ALc.c
parente4b779c492e9ffbfce806ac49acae66ab264a7da (diff)
Support C11 atomics
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index ed2ddd89..14d35f73 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2181,6 +2181,7 @@ static ALCvoid FreeContext(ALCcontext *context)
static void ReleaseContext(ALCcontext *context, ALCdevice *device)
{
ALCcontext *volatile*tmp_ctx;
+ ALCcontext *origctx;
if(altss_get(LocalContext) == context)
{
@@ -2189,7 +2190,8 @@ static void ReleaseContext(ALCcontext *context, ALCdevice *device)
ALCcontext_DecRef(context);
}
- if(ATOMIC_COMPARE_EXCHANGE(ALCcontext*, GlobalContext, context, NULL) == context)
+ origctx = context;
+ if(ATOMIC_COMPARE_EXCHANGE(ALCcontext*, GlobalContext, origctx, NULL))
ALCcontext_DecRef(context);
ALCdevice_Lock(device);