summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/tracker.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-07-06 17:04:08 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-07-06 17:04:08 +0200
commit8b4061609304743e4082e02f8c91e5ba0fd3c2a3 (patch)
tree2e74fd6e9591ccd668a3311271acb95f3e7a634b /facetracknoir/tracker.cpp
parentf822e5e1217fd0a44e17e7a0d39e115095270cc0 (diff)
Remove data race between UI and tracker thread
Diffstat (limited to 'facetracknoir/tracker.cpp')
-rw-r--r--facetracknoir/tracker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp
index e34bf25e..93b09792 100644
--- a/facetracknoir/tracker.cpp
+++ b/facetracknoir/tracker.cpp
@@ -119,6 +119,8 @@ void Tracker::run() {
{
if (should_quit)
break;
+
+ QMutexLocker foo(&mtx);
for (int i = 0; i < 6; i++)
newpose[i] = 0;
@@ -214,6 +216,7 @@ void Tracker::run() {
// Get the raw headpose, so it can be displayed.
//
void Tracker::getHeadPose( double *data ) {
+ QMutexLocker foo(&mtx);
for (int i = 0; i < 6; i++)
{
data[i] = mainApp->axis(i).headPos;
@@ -224,6 +227,7 @@ void Tracker::getHeadPose( double *data ) {
// Get the output-headpose, so it can be displayed.
//
void Tracker::getOutputHeadPose( double *data ) {
+ QMutexLocker foo(&mtx);
for (int i = 0; i < 6; i++)
data[i] = output_camera.axes[i];
}