summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-01-16 05:58:48 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:49:13 +0100
commit03d28dde1635e36508cff1f9eabc265cdb5febb9 (patch)
treeee62d5851315c7b4c2c3c05f8a72e29a6dd4a1e8 /tracker-pt
parentf8faca0abecafd6e65d07bd0fdd618070114cdfa (diff)
compat/mutex: remove
Always use the adaptive QMutex.
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp13
-rw-r--r--tracker-pt/ftnoir_tracker_pt.h3
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(&center_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(&center_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