diff options
-rw-r--r-- | Alc/ALc.c | 21 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 14 |
2 files changed, 10 insertions, 25 deletions
@@ -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); |