Use acquire-release semantics for changing deferred updates

This commit is contained in:
Chris Robinson
2020-04-07 12:46:35 -07:00
parent 0077a01667
commit 024112a53a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1621,7 +1621,7 @@ void SetDefaultChannelOrder(ALCdevice *device)
void ALCcontext::processUpdates()
{
std::lock_guard<std::mutex> _{mPropLock};
if(mDeferUpdates.exchange(false))
if(mDeferUpdates.exchange(false, std::memory_order_acq_rel))
{
/* Tell the mixer to stop applying updates, then wait for any active
* updating to finish, before providing updates.
+1 -1
View File
@@ -217,7 +217,7 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext> {
* This does *NOT* stop mixing, but rather prevents certain property
* changes from taking effect.
*/
void deferUpdates() noexcept { mDeferUpdates.store(true); }
void deferUpdates() noexcept { mDeferUpdates.exchange(true, std::memory_order_acq_rel); }
/** Resumes update processing after being deferred. */
void processUpdates();