aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-04-15 15:07:14 -0700
committerChris Robinson <[email protected]>2021-04-15 15:17:04 -0700
commit29cf7ebb752e00e116391a1df7a3ed0f49fdd193 (patch)
tree76b90d55cbcbae2bb3c04fc95aaef83161263ecc /al/source.h
parent92148a3a044389863601b8b907bcfc69ff77b869 (diff)
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.
Diffstat (limited to 'al/source.h')
-rw-r--r--al/source.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/al/source.h b/al/source.h
index 6572864f..4f4832e5 100644
--- a/al/source.h
+++ b/al/source.h
@@ -16,6 +16,7 @@
#include "almalloc.h"
#include "alnumeric.h"
#include "alu.h"
+#include "atomic.h"
#include "math_defs.h"
#include "vector.h"
#include "voice.h"
@@ -109,7 +110,7 @@ struct ALsource {
/** Source Buffer Queue head. */
al::deque<ALbufferQueueItem> mQueue;
- std::atomic_flag PropsClean;
+ al::atomic_invflag mPropsDirty;
/* Index into the context's Voices array. Lazily updated, only checked and
* reset when looking up the voice.