diff options
author | Chris Robinson <[email protected]> | 2022-12-16 18:41:47 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-16 18:41:47 -0800 |
commit | d281ffa9ce3abd8dfd5afd72914acebe4a4a92ff (patch) | |
tree | 59612d00cc9efa076c3565a743eab93378532326 /core/context.h | |
parent | 84cfef8513b88068e8ef66223d09b6c48d35caad (diff) |
Use a bitset for the enabled event flags
Diffstat (limited to 'core/context.h')
-rw-r--r-- | core/context.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/context.h b/core/context.h index 4e3ea195..9723eac3 100644 --- a/core/context.h +++ b/core/context.h @@ -3,12 +3,14 @@ #include <array> #include <atomic> +#include <bitset> #include <cstddef> #include <memory> #include <thread> #include "almalloc.h" #include "alspan.h" +#include "async_event.h" #include "atomic.h" #include "bufferline.h" #include "threads.h" @@ -135,7 +137,8 @@ struct ContextBase { std::thread mEventThread; al::semaphore mEventSem; std::unique_ptr<RingBuffer> mAsyncEvents; - std::atomic<uint> mEnabledEvts{0u}; + using AsyncEventBitset = std::bitset<AsyncEvent::UserEventCount>; + std::atomic<AsyncEventBitset> mEnabledEvts{0u}; /* Asynchronous voice change actions are processed as a linked list of * VoiceChange objects by the mixer, which is atomically appended to. |