aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-03-03 13:42:37 -0800
committerChris Robinson <[email protected]>2018-03-03 13:42:37 -0800
commit4e6c758daf1849741712eaf451f392264fd49244 (patch)
tree7db357344dac8cf7f90005ad5a5378443adf192c /Alc/ALc.c
parent4bd02eada65a9c9140c0c62524692038165e9a31 (diff)
Use a plain mutex for the property lock
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 3fd3ab8f..ab21c356 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1629,7 +1629,7 @@ void ALCcontext_DeferUpdates(ALCcontext *context)
*/
void ALCcontext_ProcessUpdates(ALCcontext *context)
{
- ReadLock(&context->PropLock);
+ almtx_lock(&context->PropLock);
if(ATOMIC_EXCHANGE_SEQ(&context->DeferUpdates, AL_FALSE))
{
/* Tell the mixer to stop applying updates, then wait for any active
@@ -1651,7 +1651,7 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
*/
ATOMIC_STORE_SEQ(&context->HoldUpdates, AL_FALSE);
}
- ReadUnlock(&context->PropLock);
+ almtx_unlock(&context->PropLock);
}
@@ -2244,7 +2244,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
UpdateEffectSlotProps(slot, context);
}
- WriteLock(&context->PropLock);
+ almtx_lock(&context->PropLock);
almtx_lock(&context->EffectSlotLock);
for(pos = 0;pos < (ALsizei)VECTOR_SIZE(context->EffectSlotList);pos++)
{
@@ -2342,7 +2342,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
ATOMIC_FLAG_TEST_AND_SET(&context->Listener->PropsClean, almemory_order_release);
UpdateListenerProps(context);
UpdateAllSourceProps(context);
- WriteUnlock(&context->PropLock);
+ almtx_unlock(&context->PropLock);
context = ATOMIC_LOAD(&context->next, almemory_order_relaxed);
}
@@ -2581,7 +2581,7 @@ static ALvoid InitContext(ALCcontext *Context)
InitRef(&Context->UpdateCount, 0);
ATOMIC_INIT(&Context->HoldUpdates, AL_FALSE);
Context->GainBoost = 1.0f;
- RWLockInit(&Context->PropLock);
+ almtx_init(&Context->PropLock, almtx_plain);
ATOMIC_INIT(&Context->LastError, AL_NO_ERROR);
VECTOR_INIT(Context->SourceList);
Context->NumSources = 0;
@@ -2763,6 +2763,8 @@ static void FreeContext(ALCcontext *context)
ll_ringbuffer_free(context->AsyncEvents);
context->AsyncEvents = NULL;
+ almtx_destroy(&context->PropLock);
+
ALCdevice_DecRef(context->Device);
context->Device = NULL;