aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c17
-rw-r--r--Alc/backends/base.c2
-rw-r--r--Alc/backends/base.h7
-rw-r--r--OpenAL32/Include/alMain.h10
4 files changed, 15 insertions, 21 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 00d75f8c..e70e83dd 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1494,17 +1494,6 @@ static ALCboolean IsValidAmbiScaling(ALCenum scaling)
* Miscellaneous ALC helpers
************************************************/
-void ALCdevice_Lock(ALCdevice *device)
-{
- V0(device->Backend,lock)();
-}
-
-void ALCdevice_Unlock(ALCdevice *device)
-{
- V0(device->Backend,unlock)();
-}
-
-
/* SetDefaultWFXChannelOrder
*
* Sets the default channel order used by WaveFormatEx.
@@ -2732,7 +2721,7 @@ static bool ReleaseContext(ALCcontext *context, ALCdevice *device)
if(ATOMIC_COMPARE_EXCHANGE_PTR_STRONG_SEQ(&GlobalContext, &origctx, NULL))
ALCcontext_DecRef(context);
- ALCdevice_Lock(device);
+ V0(device->Backend,lock)();
origctx = context;
newhead = context->next;
if(!ATOMIC_COMPARE_EXCHANGE_PTR_STRONG_SEQ(&device->ContextList, &origctx, newhead))
@@ -2750,13 +2739,13 @@ static bool ReleaseContext(ALCcontext *context, ALCdevice *device)
}
else
ret = !!newhead;
- ALCdevice_Unlock(device);
+ V0(device->Backend,unlock)();
ALCcontext_DecRef(context);
return ret;
}
-void ALCcontext_IncRef(ALCcontext *context)
+static void ALCcontext_IncRef(ALCcontext *context)
{
uint ref = IncrementRef(&context->ref);
TRACEREF("%p increasing refcount to %u\n", context, ref);
diff --git a/Alc/backends/base.c b/Alc/backends/base.c
index 5f568d8e..a451fee9 100644
--- a/Alc/backends/base.c
+++ b/Alc/backends/base.c
@@ -10,6 +10,8 @@
extern inline ALuint64 GetDeviceClockTime(ALCdevice *device);
+extern inline void ALCdevice_Lock(ALCdevice *device);
+extern inline void ALCdevice_Unlock(ALCdevice *device);
/* Base ALCbackend method implementations. */
void ALCbackend_Construct(ALCbackend *self, ALCdevice *device)
diff --git a/Alc/backends/base.h b/Alc/backends/base.h
index 8464fdee..318e86fc 100644
--- a/Alc/backends/base.h
+++ b/Alc/backends/base.h
@@ -152,4 +152,11 @@ ALCbackendFactory *ALCnullBackendFactory_getFactory(void);
ALCbackendFactory *ALCwaveBackendFactory_getFactory(void);
ALCbackendFactory *ALCloopbackFactory_getFactory(void);
+
+inline void ALCdevice_Lock(ALCdevice *device)
+{ V0(device->Backend,lock)(); }
+
+inline void ALCdevice_Unlock(ALCdevice *device)
+{ V0(device->Backend,unlock)(); }
+
#endif /* AL_BACKENDS_BASE_H */
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 76624a66..2fe7f71f 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -738,20 +738,16 @@ struct ALCcontext_struct {
ALCcontext *GetContextRef(void);
-void ALCcontext_IncRef(ALCcontext *context);
void ALCcontext_DecRef(ALCcontext *context);
+void ALCcontext_DeferUpdates(ALCcontext *context);
+void ALCcontext_ProcessUpdates(ALCcontext *context);
+
void AllocateVoices(ALCcontext *context, ALsizei num_voices, ALsizei old_sends);
void AppendAllDevicesList(const ALCchar *name);
void AppendCaptureDeviceList(const ALCchar *name);
-void ALCdevice_Lock(ALCdevice *device);
-void ALCdevice_Unlock(ALCdevice *device);
-
-void ALCcontext_DeferUpdates(ALCcontext *context);
-void ALCcontext_ProcessUpdates(ALCcontext *context);
-
extern ALint RTPrioLevel;
void SetRTPriority(void);