diff options
-rw-r--r-- | facetracknoir/tracker.cpp | 4 | ||||
-rw-r--r-- | facetracknoir/tracker.h | 1 |
2 files changed, 5 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];
}
diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index de894cf5..f452395d 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -109,6 +109,7 @@ class Tracker : public QThread { private:
FaceTrackNoIR *mainApp;
+ QMutex mtx;
protected:
// qthread override run method
|