aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-27 21:16:24 -0800
committerChris Robinson <[email protected]>2018-01-27 21:16:24 -0800
commitf16ece6048ebe3e81b892476fa0dc66f4091a4a9 (patch)
tree4892fb3b275a2164bf07fcf08cfb79888c69ec12 /OpenAL32/alAuxEffectSlot.c
parente12059a31186605ce2ed534ba42004edf3df5a6b (diff)
Move some inline functions into a header instead of copying them
Unfortunately does not include the Lookup* functions, which need the full type declaration to offset the pointer.
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r--OpenAL32/alAuxEffectSlot.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 30ca097f..70025409 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -36,6 +36,9 @@
#include "almalloc.h"
+extern inline void LockEffectSlotList(ALCcontext *context);
+extern inline void UnlockEffectSlotList(ALCcontext *context);
+
static UIntMap EffectStateFactoryMap;
static inline ALeffectStateFactory *getFactoryByType(ALenum type)
{
@@ -48,11 +51,6 @@ static inline ALeffectStateFactory *getFactoryByType(ALenum type)
static void ALeffectState_IncRef(ALeffectState *state);
-static inline void LockEffectSlotList(ALCcontext *context)
-{ almtx_lock(&context->EffectSlotLock); }
-static inline void UnlockEffectSlotList(ALCcontext *context)
-{ almtx_unlock(&context->EffectSlotLock); }
-
static inline ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id)
{
id--;
@@ -275,15 +273,15 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
case AL_EFFECTSLOT_EFFECT:
device = context->Device;
- almtx_lock(&device->EffectLock);
+ LockEffectList(device);
effect = (value ? LookupEffect(device, value) : NULL);
if(!(value == 0 || effect != NULL))
{
- almtx_unlock(&device->EffectLock);
+ UnlockEffectList(device);
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid effect ID %u", value);
}
err = InitializeEffect(context, slot, effect);
- almtx_unlock(&device->EffectLock);
+ UnlockEffectList(device);
if(err != AL_NO_ERROR)
SETERR_GOTO(context, err, done, "Effect initialization failed");