diff options
author | Chris Robinson <[email protected]> | 2016-05-10 23:42:44 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-05-10 23:42:44 -0700 |
commit | 21bc0f5ef8f0e410ea840061589b844d6e401afc (patch) | |
tree | 89b98336e44a3d9fe30640aecfcb2bf70d7a6251 /OpenAL32/Include/alBuffer.h | |
parent | 906a4bb22d6811615ccff417b6086fa36f310c00 (diff) |
Hold the buffer map lock while handling the buffer
Diffstat (limited to 'OpenAL32/Include/alBuffer.h')
-rw-r--r-- | OpenAL32/Include/alBuffer.h | 13 |
1 files changed, 11 insertions, 2 deletions
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); |