From b942fcf2224a3e59ea3dabb3d5c9eca9ba68d16f Mon Sep 17 00:00:00 2001 From: Xavier Hallade Date: Wed, 26 Aug 2015 15:10:30 +0200 Subject: tracker_rs: prevent potential thread starvation --- ftnoir_tracker_rs/ftnoir_tracker_rs.cpp | 6 ++++-- 1 file 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)); + } } } -- cgit v1.2.3