From ca2c242e6fe37376394d0a0e2b574e94c40c4b57 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Dec 2014 01:45:54 +0100 Subject: switch back to volatile bool for tracker flags UI thread is the only writer for the flags. Makes no sense to use more than volatile. --- opentrack/tracker.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'opentrack') diff --git a/opentrack/tracker.h b/opentrack/tracker.h index bf0047b4..f7f69a7b 100644 --- a/opentrack/tracker.h +++ b/opentrack/tracker.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include "timer.hpp" @@ -27,10 +26,10 @@ private: Pose output_pose, raw_6dof; double newpose[6]; - std::atomic centerp; - std::atomic enabledp; - std::atomic zero_; - std::atomic should_quit; + volatile bool centerp; + volatile bool enabledp; + volatile bool zero_; + volatile bool should_quit; SelectedLibraries const& libs; dmat<3, 3> r_b; @@ -47,7 +46,7 @@ public: void get_raw_and_mapped_poses(double* mapped, double* raw) const; void start() { QThread::start(); } - void toggle_enabled() { enabledp.store(!enabledp.load()); } - void center() { centerp.store(!centerp.load()); } - void zero() { zero_.store(!zero_.load()); } + void toggle_enabled() { enabledp = !enabledp; } + void center() { centerp = !centerp; } + void zero() { zero_ = !zero_; } }; -- cgit v1.2.3