summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_rs/ftnoir_tracker_rs.cpp
diff options
context:
space:
mode:
authorXavier Hallade <xavier.hallade@intel.com>2015-08-26 15:10:30 +0200
committerXavier Hallade <xavier.hallade@intel.com>2015-08-26 15:10:30 +0200
commitb942fcf2224a3e59ea3dabb3d5c9eca9ba68d16f (patch)
tree25905fa3ba78bedcec560b6a55f665f6c5046eab /ftnoir_tracker_rs/ftnoir_tracker_rs.cpp
parent7e7691f67e4e276a40a52f80735ff6875351a218 (diff)
tracker_rs: prevent potential thread starvation
Diffstat (limited to 'ftnoir_tracker_rs/ftnoir_tracker_rs.cpp')
-rw-r--r--ftnoir_tracker_rs/ftnoir_tracker_rs.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ftnoir_tracker_rs/ftnoir_tracker_rs.cpp b/ftnoir_tracker_rs/ftnoir_tracker_rs.cpp
index 8fa46df2..a9a50963 100644
--- a/ftnoir_tracker_rs/ftnoir_tracker_rs.cpp
+++ b/ftnoir_tracker_rs/ftnoir_tracker_rs.cpp
@@ -50,8 +50,10 @@ void RSTracker::readPendingUdpPoseData(){
while(mSocket.hasPendingDatagrams()) {
mSocket.readDatagram((char*)pose, sizeof(pose));
- QMutexLocker foo(&mMutex);
- memcpy(mPose, pose, sizeof(pose));
+ {
+ QMutexLocker foo(&mMutex);
+ memcpy(mPose, pose, sizeof(pose));
+ }
}
}