summaryrefslogtreecommitdiffhomepage
path: root/tracker-tobii-eyex/tobii-eyex.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:19:17 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:48:42 +0200
commite88c7b29ea9ec9fcd6ac6b15c965085152100d2e (patch)
tree6747fe7fa797e024b986ba624d05e6f59032f0ac /tracker-tobii-eyex/tobii-eyex.hpp
parent646530b5f9ca5debe7a9b4840192e32e43f919bf (diff)
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<t>. 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.
Diffstat (limited to 'tracker-tobii-eyex/tobii-eyex.hpp')
-rw-r--r--tracker-tobii-eyex/tobii-eyex.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tracker-tobii-eyex/tobii-eyex.hpp b/tracker-tobii-eyex/tobii-eyex.hpp
index 23173f22..62b0d733 100644
--- a/tracker-tobii-eyex/tobii-eyex.hpp
+++ b/tracker-tobii-eyex/tobii-eyex.hpp
@@ -19,6 +19,7 @@ using namespace options;
#include <functional>
#include <atomic>
+
#include <QObject>
#include <QMutex>
@@ -77,7 +78,7 @@ private:
} dev_state;
double yaw, pitch;
- volatile bool do_center;
+ std::atomic<bool> do_center;
};
class tobii_eyex_metadata : public Metadata