From 03d28dde1635e36508cff1f9eabc265cdb5febb9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 16 Jan 2019 05:58:48 +0100 Subject: compat/mutex: remove Always use the adaptive QMutex. --- logic/pipeline.cpp | 6 +++--- logic/pipeline.hpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'logic') diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 67669732..c355bf19 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -601,7 +601,7 @@ void pipeline::toggle_enabled() { b.negate(f_enabled_p); } void bits::set(bit_flags flag, bool val) { - spinlock_guard l(lock); + QMutexLocker l(&lock); flags &= ~flag; if (val) @@ -610,14 +610,14 @@ void bits::set(bit_flags flag, bool val) void bits::negate(bit_flags flag) { - spinlock_guard l(lock); + QMutexLocker l(&lock); flags ^= flag; } bool bits::get(bit_flags flag) { - spinlock_guard l(lock); + QMutexLocker l(&lock); return !!(flags & flag); } diff --git a/logic/pipeline.hpp b/logic/pipeline.hpp index 40088a5d..545a7836 100644 --- a/logic/pipeline.hpp +++ b/logic/pipeline.hpp @@ -7,7 +7,6 @@ #include "mappings.hpp" #include "compat/euler.hpp" #include "compat/enum-operators.hpp" -#include "compat/spinlock.hpp" #include "runtime-libraries.hpp" #include "extensions.hpp" @@ -70,7 +69,7 @@ enum bit_flags : unsigned { struct OTR_LOGIC_EXPORT bits { bit_flags flags{0}; - std::atomic_flag lock = ATOMIC_FLAG_INIT; + QMutex lock; void set(bit_flags flag, bool val); void negate(bit_flags flag); -- cgit v1.2.3