diff options
author | Chris Robinson <[email protected]> | 2014-07-23 06:36:34 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-23 06:36:34 -0700 |
commit | a3dbe08c8b9df301dded52ad78f655c2753be56c (patch) | |
tree | 69e5d4fd8f3a195bfae430d9a9a5dedf660509f7 /Alc | |
parent | e4b779c492e9ffbfce806ac49acae66ab264a7da (diff) |
Support C11 atomics
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |