diff options
author | Chris Robinson <[email protected]> | 2018-11-26 21:37:58 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-26 21:39:31 -0800 |
commit | 2e73c2ca929b6cea23195270fe144f9ad3ae5c27 (patch) | |
tree | 697d2e65e4ca6ee5bfcf718b37a6073b766bff70 /OpenAL32 | |
parent | d8b9230ee4770095b0848aa38752e19d0090dd6a (diff) |
Use a standard mutex for the proplock
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alAuxEffectSlot.cpp | 4 | ||||
-rw-r--r-- | OpenAL32/alListener.cpp | 24 | ||||
-rw-r--r-- | OpenAL32/alSource.cpp | 24 | ||||
-rw-r--r-- | OpenAL32/alState.cpp | 26 | ||||
-rw-r--r-- | OpenAL32/event.cpp | 2 |
5 files changed, 40 insertions, 40 deletions
diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp index 43e99584..539329a7 100644 --- a/OpenAL32/alAuxEffectSlot.cpp +++ b/OpenAL32/alAuxEffectSlot.cpp @@ -287,7 +287,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->EffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); if(UNLIKELY(!slot)) @@ -358,7 +358,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->EffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); if(UNLIKELY(!slot)) diff --git a/OpenAL32/alListener.cpp b/OpenAL32/alListener.cpp index 2d3482bf..c86c8374 100644 --- a/OpenAL32/alListener.cpp +++ b/OpenAL32/alListener.cpp @@ -43,7 +43,7 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value) if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; switch(param) { case AL_GAIN: @@ -76,7 +76,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; switch(param) { case AL_POSITION: @@ -125,7 +125,7 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values) if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!values) SETERR_RETURN(context.get(), AL_INVALID_VALUE,, "NULL pointer"); switch(param) { @@ -154,7 +154,7 @@ AL_API ALvoid AL_APIENTRY alListeneri(ALenum param, ALint UNUSED(value)) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; switch(param) { default: @@ -176,7 +176,7 @@ AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, A ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; switch(param) { default: @@ -212,7 +212,7 @@ AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!values) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) @@ -229,7 +229,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value) if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!value) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) @@ -254,7 +254,7 @@ AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!value1 || !value2 || !value3) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) @@ -296,7 +296,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values) if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!values) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) @@ -322,7 +322,7 @@ AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum param, ALint *value) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!value) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) @@ -339,7 +339,7 @@ AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *valu if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!value1 || !value2 || !value3) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) @@ -376,7 +376,7 @@ AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint* values) if(UNLIKELY(!context)) return; ALlistener &listener = context->Listener; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; if(!values) alSetError(context.get(), AL_INVALID_VALUE, "NULL pointer"); else switch(param) diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index 0515074c..bbcd318e 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -2192,7 +2192,7 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2208,7 +2208,7 @@ AL_API ALvoid AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1 ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2227,7 +2227,7 @@ AL_API ALvoid AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2246,7 +2246,7 @@ AL_API ALvoid AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble va ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2265,7 +2265,7 @@ AL_API ALvoid AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble v ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2284,7 +2284,7 @@ AL_API ALvoid AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdo ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2314,7 +2314,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2330,7 +2330,7 @@ AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, AL ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2349,7 +2349,7 @@ AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *val ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source = LookupSource(context.get(), source); if(UNLIKELY(!Source)) @@ -2368,7 +2368,7 @@ AL_API ALvoid AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SO ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source{LookupSource(context.get(), source)}; if(UNLIKELY(!Source)) @@ -2384,7 +2384,7 @@ AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOF ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source{LookupSource(context.get(), source)}; if(UNLIKELY(!Source)) @@ -2403,7 +2403,7 @@ AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALin ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<almtx_t> __{context->SourceLock}; ALsource *Source{LookupSource(context.get(), source)}; if(UNLIKELY(!Source)) diff --git a/OpenAL32/alState.cpp b/OpenAL32/alState.cpp index e2cd96d6..37bddea3 100644 --- a/OpenAL32/alState.cpp +++ b/OpenAL32/alState.cpp @@ -79,7 +79,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; switch(capability) { case AL_SOURCE_DISTANCE_MODEL: @@ -97,7 +97,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; switch(capability) { case AL_SOURCE_DISTANCE_MODEL: @@ -115,7 +115,7 @@ AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return AL_FALSE; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; ALboolean value{AL_FALSE}; switch(capability) { @@ -135,7 +135,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return AL_FALSE; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; ALboolean value{AL_FALSE}; switch(pname) { @@ -190,7 +190,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return 0.0; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; ALdouble value{0.0}; switch(pname) { @@ -239,7 +239,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return 0.0f; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; ALfloat value{0.0f}; switch(pname) { @@ -288,7 +288,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return 0; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; ALint value{0}; switch(pname) { @@ -337,7 +337,7 @@ extern "C" AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return 0; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; ALint64SOFT value{0}; switch(pname) { @@ -386,7 +386,7 @@ AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return nullptr; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; void *value{nullptr}; switch(pname) { @@ -648,7 +648,7 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value) alSetError(context.get(), AL_INVALID_VALUE, "Doppler factor %f out of range", value); else { - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; context->DopplerFactor = value; DO_UPDATEPROPS(); } @@ -675,7 +675,7 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value) alSetError(context.get(), AL_INVALID_VALUE, "Doppler velocity %f out of range", value); else { - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; context->DopplerVelocity = value; DO_UPDATEPROPS(); } @@ -690,7 +690,7 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat value) alSetError(context.get(), AL_INVALID_VALUE, "Speed of sound %f out of range", value); else { - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; context->SpeedOfSound = value; DO_UPDATEPROPS(); } @@ -708,7 +708,7 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value) alSetError(context.get(), AL_INVALID_VALUE, "Distance model 0x%04x out of range", value); else { - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; context->mDistanceModel = static_cast<DistanceModel>(value); if(!context->SourceDistanceModel) DO_UPDATEPROPS(); diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp index 0491c7c6..233794bd 100644 --- a/OpenAL32/event.cpp +++ b/OpenAL32/event.cpp @@ -135,7 +135,7 @@ AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *user ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - std::lock_guard<almtx_t> _{context->PropLock}; + std::lock_guard<std::mutex> _{context->PropLock}; std::lock_guard<std::mutex> __{context->EventCbLock}; context->EventCb = callback; context->EventParam = userParam; |