From 843cff0537ca07446ab01421ffc7aa6181414502 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 8 Feb 2022 09:39:02 -0800 Subject: Hold mPropLock when deferring updates --- alc/context.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'alc/context.h') diff --git a/alc/context.h b/alc/context.h index b22aaf62..22c2418a 100644 --- a/alc/context.h +++ b/alc/context.h @@ -153,11 +153,15 @@ struct ALCcontext : public al::intrusive_ref, ContextBase { /** * Defers/suspends updates for the given context's listener and sources. * This does *NOT* stop mixing, but rather prevents certain property - * changes from taking effect. + * changes from taking effect. mPropLock must be held when called. */ - void deferUpdates() noexcept { mDeferUpdates.exchange(true, std::memory_order_acq_rel); } + bool deferUpdates() noexcept + { return mDeferUpdates.exchange(true, std::memory_order_acq_rel); } - /** Resumes update processing after being deferred. */ + /** + * Resumes update processing after being deferred. mPropLock must be held + * when called. + */ void processUpdates(); #ifdef __USE_MINGW_ANSI_STDIO -- cgit v1.2.3