diff options
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.cpp | 13 | ||||
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 3 |
2 files changed, 6 insertions, 10 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index da295e39..76d10d1d 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -10,12 +10,9 @@ #include "cv/video-widget.hpp" #include "compat/camera-names.hpp" #include "compat/math-imports.hpp" -#include "compat/spinlock.hpp" #include "pt-api.hpp" -#include <cmath> - #include <QHBoxLayout> #include <QDebug> #include <QFile> @@ -77,7 +74,7 @@ void Tracker_PT::run() Affine X_CM; { - spinlock_guard l(center_flag); + QMutexLocker l(¢er_lock); if (success) { @@ -88,7 +85,7 @@ void Tracker_PT::run() ever_success = true; } - spinlock_guard l2(data_lock); + QMutexLocker l2(&data_lock); X_CM = point_tracker.pose(); } @@ -151,7 +148,7 @@ void Tracker_PT::data(double *data) { Affine X_CM; { - spinlock_guard l(&data_lock); + QMutexLocker l(&data_lock); X_CM = point_tracker.pose(); } @@ -189,7 +186,7 @@ void Tracker_PT::data(double *data) bool Tracker_PT::center() { - spinlock_guard l(center_flag); + QMutexLocker l(¢er_lock); point_tracker.reset_state(); return false; @@ -211,7 +208,7 @@ bool Tracker_PT::get_cam_info(pt_camera_info& info) Affine Tracker_PT::pose() const { - spinlock_guard l(data_lock); + QMutexLocker l(&data_lock); return point_tracker.pose(); } diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index 5e9ad9b3..0226fd87 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -75,8 +75,7 @@ private: std::atomic<unsigned> point_count { 0 }; std::atomic<bool> ever_success { false }; - mutable std::atomic_flag center_flag = ATOMIC_FLAG_INIT; - mutable std::atomic_flag data_lock = ATOMIC_FLAG_INIT; + mutable QMutex center_lock, data_lock; }; } // ns pt_impl |