aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-21 05:35:47 -0800
committerChris Robinson <[email protected]>2018-11-21 05:35:47 -0800
commit75213ee6f951355906bd1744a2936bb764f23e40 (patch)
treead33740d5373728f995213e60af6d06d19782ccb /Alc
parent757c42c74bb1f88dfc6f24200382a0ea741fccac (diff)
Always use RAII with EffectSlotLock
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alc.cpp4
-rw-r--r--Alc/alcontext.h5
2 files changed, 2 insertions, 7 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index fa7b9f44..28c9bc6f 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2263,7 +2263,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
}
almtx_lock(&context->PropLock);
- almtx_lock(&context->EffectSlotLock);
+ std::unique_lock<almtx_t> slotlock{context->EffectSlotLock};
for(auto &slot : context->EffectSlotList)
{
EffectState *state = slot->Effect.State;
@@ -2275,7 +2275,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
else
UpdateEffectSlotProps(slot.get(), context);
}
- almtx_unlock(&context->EffectSlotLock);
+ slotlock.unlock();
almtx_lock(&context->SourceLock);
for(auto &sublist : context->SourceList)
diff --git a/Alc/alcontext.h b/Alc/alcontext.h
index 26616f18..c9cfa985 100644
--- a/Alc/alcontext.h
+++ b/Alc/alcontext.h
@@ -135,11 +135,6 @@ void UpdateContextProps(ALCcontext *context);
void ALCcontext_DeferUpdates(ALCcontext *context);
void ALCcontext_ProcessUpdates(ALCcontext *context);
-inline void LockEffectSlotList(ALCcontext *context)
-{ almtx_lock(&context->EffectSlotLock); }
-inline void UnlockEffectSlotList(ALCcontext *context)
-{ almtx_unlock(&context->EffectSlotLock); }
-
/* Simple RAII context reference. Takes the reference of the provided
* ALCcontext, and decrements it when leaving scope. Movable (transfer