From e88c7b29ea9ec9fcd6ac6b15c965085152100d2e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Jun 2017 18:19:17 +0200 Subject: get rid of "volatile" abuse We heavily used "volatile bool" to check if the thread loop should stop. But this functionality is already provided by Qt5's QThread::requestInterruption. In other cases, "volatile" is wonderfully underspecified so it's better to ditch its usage in favor of std::atomic. At the time we don't appear to be using the "volatile" keyword except when calling win32's Interlocked*() family of functions as necessary. In freetrackclient's header the "volatile" qualifier was used as part of a typedef. This doesn't work. Use it as part of data declaration. --- tracker-hydra/ftnoir_tracker_hydra.cpp | 2 +- tracker-hydra/ftnoir_tracker_hydra.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'tracker-hydra') diff --git a/tracker-hydra/ftnoir_tracker_hydra.cpp b/tracker-hydra/ftnoir_tracker_hydra.cpp index 77e62243..9c0d85f8 100644 --- a/tracker-hydra/ftnoir_tracker_hydra.cpp +++ b/tracker-hydra/ftnoir_tracker_hydra.cpp @@ -23,7 +23,7 @@ #endif #include -Hydra_Tracker::Hydra_Tracker() : should_quit(false) {} +Hydra_Tracker::Hydra_Tracker() {} #include diff --git a/tracker-hydra/ftnoir_tracker_hydra.h b/tracker-hydra/ftnoir_tracker_hydra.h index 31a994d5..15016e4e 100644 --- a/tracker-hydra/ftnoir_tracker_hydra.h +++ b/tracker-hydra/ftnoir_tracker_hydra.h @@ -18,7 +18,6 @@ public: ~Hydra_Tracker(); void start_tracker(QFrame *) override; void data(double *data) override; - volatile bool should_quit; private: settings s; QMutex mutex; -- cgit v1.2.3