From 21bc0f5ef8f0e410ea840061589b844d6e401afc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 10 May 2016 23:42:44 -0700 Subject: Hold the buffer map lock while handling the buffer --- OpenAL32/Include/alBuffer.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenAL32/Include/alBuffer.h') diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h index 71fe7e30..4807dd16 100644 --- a/OpenAL32/Include/alBuffer.h +++ b/OpenAL32/Include/alBuffer.h @@ -106,10 +106,19 @@ void DeleteBuffer(ALCdevice *device, ALbuffer *buffer); ALenum LoadData(ALbuffer *buffer, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels SrcChannels, enum UserFmtType SrcType, const ALvoid *data, ALsizei align, ALboolean storesrc); +inline void LockBuffersRead(ALCdevice *device) +{ LockUIntMapRead(&device->BufferMap); } +inline void UnlockBuffersRead(ALCdevice *device) +{ UnlockUIntMapRead(&device->BufferMap); } +inline void LockBuffersWrite(ALCdevice *device) +{ LockUIntMapWrite(&device->BufferMap); } +inline void UnlockBuffersWrite(ALCdevice *device) +{ UnlockUIntMapWrite(&device->BufferMap); } + inline struct ALbuffer *LookupBuffer(ALCdevice *device, ALuint id) -{ return (struct ALbuffer*)LookupUIntMapKey(&device->BufferMap, id); } +{ return (struct ALbuffer*)LookupUIntMapKeyNoLock(&device->BufferMap, id); } inline struct ALbuffer *RemoveBuffer(ALCdevice *device, ALuint id) -{ return (struct ALbuffer*)RemoveUIntMapKey(&device->BufferMap, id); } +{ return (struct ALbuffer*)RemoveUIntMapKeyNoLock(&device->BufferMap, id); } ALvoid ReleaseALBuffers(ALCdevice *device); -- cgit v1.2.3