diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alc.cpp | 4 | ||||
-rw-r--r-- | Alc/alcontext.h | 5 |
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 |