summaryrefslogtreecommitdiffhomepage
path: root/logic/pipeline.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-29 13:32:06 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:48:19 +0100
commitd6735a31fd37da160d690148efd896077f0a8f65 (patch)
tree6f19c3d391cc28cd97b4d273f755fa042dbbb2f7 /logic/pipeline.hpp
parent9fd246a411e9faaf49c6b18c020fde351b9412a6 (diff)
logic/pipeline: replace clunky atomic ops w/ a spinlock
Diffstat (limited to 'logic/pipeline.hpp')
-rw-r--r--logic/pipeline.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/logic/pipeline.hpp b/logic/pipeline.hpp
index a4dcb6b8..bce0bd76 100644
--- a/logic/pipeline.hpp
+++ b/logic/pipeline.hpp
@@ -7,6 +7,7 @@
#include "mappings.hpp"
#include "compat/euler.hpp"
#include "compat/enum-operators.hpp"
+#include "compat/spinlock.hpp"
#include "runtime-libraries.hpp"
#include "extensions.hpp"
@@ -58,6 +59,7 @@ public:
using namespace time_units;
enum bit_flags : unsigned {
+ f_none = 0,
f_center = 1 << 0,
f_held_center = 1 << 1,
f_enabled_h = 1 << 2,
@@ -67,7 +69,8 @@ enum bit_flags : unsigned {
struct OTR_LOGIC_EXPORT bits
{
- std::atomic<unsigned> b;
+ bit_flags flags{0};
+ std::atomic_flag lock = ATOMIC_FLAG_INIT;
void set(bit_flags flag, bool val);
void negate(bit_flags flag);