diff options
author | Chris Robinson <[email protected]> | 2012-01-09 23:37:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-01-09 23:37:03 -0800 |
commit | 535091e36c994b9c9363728cfa348f70ba545811 (patch) | |
tree | b138481972bdec757ab4aee414f389987bfe820e | |
parent | 5b7f8c1816544102011815ee570093c3ae7d339e (diff) |
Make LockDevice, LockContext, etc, inline
-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); |