summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 7589242d..cee9c2a0 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -10,6 +10,7 @@
#include "cv/video-widget.hpp"
#include "compat/camera-names.hpp"
#include "compat/math-imports.hpp"
+#include "compat/spinlock.hpp"
#include "pt-api.hpp"
@@ -65,8 +66,7 @@ void Tracker_PT::run()
if (new_frame)
{
- while (center_flag.test_and_set())
- (void)0;
+ spinlock_guard l(center_flag);
*preview_frame = *frame;
@@ -112,8 +112,6 @@ void Tracker_PT::run()
preview_frame = traits->make_preview(w, h);
}
}
-
- center_flag.clear();
}
}
}
@@ -189,13 +187,9 @@ void Tracker_PT::data(double *data)
bool Tracker_PT::center()
{
- while (center_flag.test_and_set())
- (void)0;
+ spinlock_guard l(center_flag);
point_tracker.reset_state();
-
- center_flag.clear();
-
return false;
}