diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 6 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.cpp | 2 | ||||
-rw-r--r-- | OpenAL32/alBuffer.cpp | 48 | ||||
-rw-r--r-- | OpenAL32/alEffect.cpp | 28 | ||||
-rw-r--r-- | OpenAL32/alFilter.cpp | 28 | ||||
-rw-r--r-- | OpenAL32/alSource.cpp | 14 |
6 files changed, 56 insertions, 70 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 3643dd77..cf1cd6b2 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -700,15 +700,15 @@ struct ALCdevice_struct { // Map of Buffers for this device al::vector<BufferSubList> BufferList; - almtx_t BufferLock; + std::mutex BufferLock; // Map of Effects for this device al::vector<EffectSubList> EffectList; - almtx_t EffectLock; + std::mutex EffectLock; // Map of Filters for this device al::vector<FilterSubList> FilterList; - almtx_t FilterLock; + std::mutex FilterLock; POSTPROCESS PostProcess{}; diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp index d8c5076a..663d99ba 100644 --- a/OpenAL32/alAuxEffectSlot.cpp +++ b/OpenAL32/alAuxEffectSlot.cpp @@ -300,7 +300,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param case AL_EFFECTSLOT_EFFECT: device = context->Device; - { std::lock_guard<almtx_t> ___{device->EffectLock}; + { std::lock_guard<std::mutex> ___{device->EffectLock}; ALeffect *effect{value ? LookupEffect(device, value) : nullptr}; if(!(value == 0 || effect != nullptr)) SETERR_RETURN(context.get(), AL_INVALID_VALUE,, "Invalid effect ID %u", value); diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp index 1b50f075..dbd48ad0 100644 --- a/OpenAL32/alBuffer.cpp +++ b/OpenAL32/alBuffer.cpp @@ -52,9 +52,8 @@ constexpr ALbitfieldSOFT INVALID_MAP_FLAGS{~unsigned(AL_MAP_READ_BIT_SOFT | AL_M ALbuffer *AllocBuffer(ALCcontext *context) { - ALCdevice *device = context->Device; - std::unique_lock<almtx_t> buflock{device->BufferLock}; - + ALCdevice *device{context->Device}; + std::lock_guard<std::mutex> _{device->BufferLock}; auto sublist = std::find_if(device->BufferList.begin(), device->BufferList.end(), [](const BufferSubList &entry) noexcept -> bool { return entry.FreeMask != 0; } @@ -75,7 +74,6 @@ ALbuffer *AllocBuffer(ALCcontext *context) */ if(UNLIKELY(device->BufferList.size() >= 1<<25)) { - buflock.unlock(); alSetError(context, AL_OUT_OF_MEMORY, "Too many buffers allocated"); return nullptr; } @@ -86,7 +84,6 @@ ALbuffer *AllocBuffer(ALCcontext *context) if(UNLIKELY(!sublist->Buffers)) { device->BufferList.pop_back(); - buflock.unlock(); alSetError(context, AL_OUT_OF_MEMORY, "Failed to allocate buffer batch"); return nullptr; } @@ -469,7 +466,7 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; /* First try to find any buffers that are invalid or in-use. */ const ALuint *buffers_end = buffers + n; @@ -510,7 +507,7 @@ AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer) if(LIKELY(context)) { ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(!buffer || LookupBuffer(device, buffer)) return AL_TRUE; } @@ -527,7 +524,7 @@ AL_API void AL_APIENTRY alBufferStorageSOFT(ALuint buffer, ALenum format, const if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -562,7 +559,7 @@ AL_API void* AL_APIENTRY alMapBufferSOFT(ALuint buffer, ALsizei offset, ALsizei if(UNLIKELY(!context)) return nullptr; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -612,7 +609,7 @@ AL_API void AL_APIENTRY alUnmapBufferSOFT(ALuint buffer) if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -633,7 +630,7 @@ AL_API void AL_APIENTRY alFlushMappedBufferSOFT(ALuint buffer, ALsizei offset, A if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -663,7 +660,7 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, cons if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -787,7 +784,7 @@ AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat UNUSED(va if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -805,7 +802,7 @@ AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat UNUSED(v if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -823,7 +820,7 @@ AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *v if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -843,7 +840,7 @@ AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value) if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -876,7 +873,7 @@ AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint UNUSED(val if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -905,7 +902,7 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *val if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -941,7 +938,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *val if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) @@ -962,7 +959,7 @@ AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *valu if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -989,7 +986,7 @@ AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *valu if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -1009,8 +1006,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; - + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); @@ -1055,8 +1051,7 @@ AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1 if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; - + std::lock_guard<std::mutex> _{device->BufferLock}; if(UNLIKELY(LookupBuffer(device, buffer) == nullptr)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); else if(UNLIKELY(!value1 || !value2 || !value3)) @@ -1090,8 +1085,7 @@ AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values if(UNLIKELY(!context)) return; ALCdevice *device = context->Device; - std::lock_guard<almtx_t> _{device->BufferLock}; - + std::lock_guard<std::mutex> _{device->BufferLock}; ALbuffer *albuf = LookupBuffer(device, buffer); if(UNLIKELY(!albuf)) alSetError(context.get(), AL_INVALID_NAME, "Invalid buffer ID %u", buffer); diff --git a/OpenAL32/alEffect.cpp b/OpenAL32/alEffect.cpp index 7f479c83..1c08d402 100644 --- a/OpenAL32/alEffect.cpp +++ b/OpenAL32/alEffect.cpp @@ -209,9 +209,8 @@ void InitEffectParams(ALeffect *effect, ALenum type) ALeffect *AllocEffect(ALCcontext *context) { - ALCdevice *device = context->Device; - almtx_lock(&device->EffectLock); - + ALCdevice *device{context->Device}; + std::lock_guard<std::mutex> _{device->EffectLock}; auto sublist = std::find_if(device->EffectList.begin(), device->EffectList.end(), [](const EffectSubList &entry) noexcept -> bool { return entry.FreeMask != 0; } @@ -232,7 +231,6 @@ ALeffect *AllocEffect(ALCcontext *context) */ if(UNLIKELY(device->EffectList.size() >= 1<<25)) { - almtx_unlock(&device->EffectLock); alSetError(context, AL_OUT_OF_MEMORY, "Too many effects allocated"); return NULL; } @@ -243,7 +241,6 @@ ALeffect *AllocEffect(ALCcontext *context) if(UNLIKELY(!sublist->Effects)) { device->EffectList.pop_back(); - almtx_unlock(&device->EffectLock); alSetError(context, AL_OUT_OF_MEMORY, "Failed to allocate effect batch"); return NULL; } @@ -259,7 +256,6 @@ ALeffect *AllocEffect(ALCcontext *context) effect->id = ((lidx<<6) | slidx) + 1; sublist->FreeMask &= ~(U64(1)<<slidx); - almtx_unlock(&device->EffectLock); return effect; } @@ -342,7 +338,7 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; /* First try to find any effects that are invalid. */ const ALuint *effects_end = effects + n; @@ -378,7 +374,7 @@ AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect) if(LIKELY(context)) { ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; if(!effect || LookupEffect(device, effect)) return AL_TRUE; } @@ -391,7 +387,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint value) if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -433,7 +429,7 @@ AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *v if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -451,7 +447,7 @@ AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat value) if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -469,7 +465,7 @@ AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -487,7 +483,7 @@ AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *value if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -517,7 +513,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *valu if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -535,7 +531,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *val if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) @@ -553,7 +549,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *va if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->EffectLock}; + std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; if(UNLIKELY(!aleffect)) diff --git a/OpenAL32/alFilter.cpp b/OpenAL32/alFilter.cpp index 390432cb..52135569 100644 --- a/OpenAL32/alFilter.cpp +++ b/OpenAL32/alFilter.cpp @@ -269,9 +269,8 @@ void InitFilterParams(ALfilter *filter, ALenum type) ALfilter *AllocFilter(ALCcontext *context) { - ALCdevice *device = context->Device; - almtx_lock(&device->FilterLock); - + ALCdevice *device{context->Device}; + std::lock_guard<std::mutex> _{device->FilterLock}; auto sublist = std::find_if(device->FilterList.begin(), device->FilterList.end(), [](const FilterSubList &entry) noexcept -> bool { return entry.FreeMask != 0; } @@ -292,7 +291,6 @@ ALfilter *AllocFilter(ALCcontext *context) */ if(UNLIKELY(device->FilterList.size() >= 1<<25)) { - almtx_unlock(&device->FilterLock); alSetError(context, AL_OUT_OF_MEMORY, "Too many filters allocated"); return NULL; } @@ -303,7 +301,6 @@ ALfilter *AllocFilter(ALCcontext *context) if(UNLIKELY(!sublist->Filters)) { device->FilterList.pop_back(); - almtx_unlock(&device->FilterLock); alSetError(context, AL_OUT_OF_MEMORY, "Failed to allocate filter batch"); return NULL; } @@ -319,7 +316,6 @@ ALfilter *AllocFilter(ALCcontext *context) filter->id = ((lidx<<6) | slidx) + 1; sublist->FreeMask &= ~(U64(1)<<slidx); - almtx_unlock(&device->FilterLock); return filter; } @@ -403,7 +399,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; /* First try to find any filters that are invalid. */ const ALuint *filters_end = filters + n; @@ -439,7 +435,7 @@ AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter) if(LIKELY(context)) { ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; if(!filter || LookupFilter(device, filter)) return AL_TRUE; } @@ -453,7 +449,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint value) if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -489,7 +485,7 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *v if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -507,7 +503,7 @@ AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat value) if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -525,7 +521,7 @@ AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -543,7 +539,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *value if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -573,7 +569,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *valu if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -591,7 +587,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *val if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) @@ -609,7 +605,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *va if(UNLIKELY(!context)) return; ALCdevice *device{context->Device}; - std::lock_guard<almtx_t> _{device->FilterLock}; + std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; if(UNLIKELY(!alfilt)) diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index 2370487f..7cba253a 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -1208,8 +1208,8 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co ALeffectslot *slot{nullptr}; ALbufferlistitem *oldlist{nullptr}; std::unique_lock<std::mutex> slotlock; - std::unique_lock<almtx_t> filtlock; - std::unique_lock<almtx_t> buflock; + std::unique_lock<std::mutex> filtlock; + std::unique_lock<std::mutex> buflock; ALfloat fvals[6]; switch(prop) @@ -1254,7 +1254,7 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co return AL_TRUE; case AL_BUFFER: - buflock = std::unique_lock<almtx_t>{device->BufferLock}; + buflock = std::unique_lock<std::mutex>{device->BufferLock}; if(!(*values == 0 || (buffer=LookupBuffer(device, *values)) != nullptr)) SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid buffer ID %u", *values); @@ -1336,7 +1336,7 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co return AL_TRUE; case AL_DIRECT_FILTER: - filtlock = std::unique_lock<almtx_t>{device->FilterLock}; + filtlock = std::unique_lock<std::mutex>{device->FilterLock}; if(!(*values == 0 || (filter=LookupFilter(device, *values)) != nullptr)) SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid filter ID %u", *values); @@ -1426,7 +1426,7 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co if((ALuint)values[1] >= (ALuint)device->NumAuxSends) SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid send %u", values[1]); - filtlock = std::unique_lock<almtx_t>{device->FilterLock}; + filtlock = std::unique_lock<std::mutex>{device->FilterLock}; if(!(values[2] == 0 || (filter=LookupFilter(device, values[2])) != nullptr)) SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid filter ID %u", values[2]); @@ -3004,7 +3004,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu BufferList = BufferList->next.load(std::memory_order_relaxed); } - std::unique_lock<almtx_t> buflock{device->BufferLock}; + std::unique_lock<std::mutex> buflock{device->BufferLock}; ALbufferlistitem *BufferListStart{nullptr}; BufferList = nullptr; for(ALsizei i{0};i < nb;i++) @@ -3121,7 +3121,7 @@ AL_API void AL_APIENTRY alSourceQueueBufferLayersSOFT(ALuint src, ALsizei nb, co BufferList = BufferList->next.load(std::memory_order_relaxed); } - std::unique_lock<almtx_t> buflock{device->BufferLock}; + std::unique_lock<std::mutex> buflock{device->BufferLock}; auto BufferListStart = static_cast<ALbufferlistitem*>(al_calloc(DEF_ALIGN, FAM_SIZE(ALbufferlistitem, buffers, nb))); BufferList = BufferListStart; |