From 024112a53afeca55216f3cb7b49579419494cea6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 7 Apr 2020 12:46:35 -0700 Subject: Use acquire-release semantics for changing deferred updates --- alc/alc.cpp | 2 +- alc/alcontext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'alc') diff --git a/alc/alc.cpp b/alc/alc.cpp index bd88023b..31d06993 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1621,7 +1621,7 @@ void SetDefaultChannelOrder(ALCdevice *device) void ALCcontext::processUpdates() { std::lock_guard _{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. diff --git a/alc/alcontext.h b/alc/alcontext.h index a3da7e10..d62fc7d5 100644 --- a/alc/alcontext.h +++ b/alc/alcontext.h @@ -217,7 +217,7 @@ struct ALCcontext : public al::intrusive_ref { * 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(); -- cgit v1.2.3