From 29cf7ebb752e00e116391a1df7a3ed0f49fdd193 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 15 Apr 2021 15:07:14 -0700 Subject: Make an inverted atomic flag type and use it The inverted atomic flag replaces test_and_set+clear with test_and_clear+set, essentially inverting the flag status. This makes more logical sense for flagging dirty state, which is less confusing than flagging clean state. The one caveat is ATOMIC_FLAG_INIT (or default construction in C++20) initializes the state to true rather than false. --- al/state.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'al/state.cpp') diff --git a/al/state.cpp b/al/state.cpp index ae761fb8..e2f164ca 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -142,7 +142,7 @@ END_API_FUNC if(!context->mDeferUpdates.load(std::memory_order_acquire)) \ UpdateContextProps(context.get()); \ else \ - context->mPropsClean.clear(std::memory_order_release); \ + context->mPropsDirty.set(std::memory_order_release); \ } while(0) -- cgit v1.2.3