aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c21
-rw-r--r--OpenAL32/Include/alMain.h14
2 files changed, 10 insertions, 25 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index c741ec55..72a9703a 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1341,17 +1341,6 @@ static ALCdevice *VerifyDevice(ALCdevice *device)
}
-ALCvoid LockDevice(ALCdevice *device)
-{
- EnterCriticalSection(&device->Mutex);
-}
-
-ALCvoid UnlockDevice(ALCdevice *device)
-{
- LeaveCriticalSection(&device->Mutex);
-}
-
-
/* InitContext
*
* Initializes context variables
@@ -1525,16 +1514,6 @@ static ALCcontext *VerifyContext(ALCcontext *context)
}
-ALCvoid LockContext(ALCcontext *context)
-{
- EnterCriticalSection(&context->Device->Mutex);
-}
-
-ALCvoid UnlockContext(ALCcontext *context)
-{
- LeaveCriticalSection(&context->Device->Mutex);
-}
-
/* GetContextRef
*
* Returns the currently active context, and adds a reference without locking
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index b8057fa1..3cc82617 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -758,10 +758,16 @@ void AppendDeviceList(const ALCchar *name);
void AppendAllDeviceList(const ALCchar *name);
void AppendCaptureDeviceList(const ALCchar *name);
-ALCvoid LockDevice(ALCdevice *device);
-ALCvoid UnlockDevice(ALCdevice *device);
-ALCvoid LockContext(ALCcontext *context);
-ALCvoid UnlockContext(ALCcontext *context);
+static __inline void LockDevice(ALCdevice *device)
+{ EnterCriticalSection(&device->Mutex); }
+static __inline void UnlockDevice(ALCdevice *device)
+{ LeaveCriticalSection(&device->Mutex); }
+
+static __inline void LockContext(ALCcontext *context)
+{ LockDevice(context->Device); }
+static __inline void UnlockContext(ALCcontext *context)
+{ UnlockDevice(context->Device); }
+
ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr);
ALuint StopThread(ALvoid *thread);