diff --git a/source/RobotAPI/components/units/HeadIKUnit.cpp b/source/RobotAPI/components/units/HeadIKUnit.cpp index b893a82f80a8de27b14a1a52d9de0fb0dd60e72a..1882ee6185d08d15f7824296eb44eb758d890d7e 100644 --- a/source/RobotAPI/components/units/HeadIKUnit.cpp +++ b/source/RobotAPI/components/units/HeadIKUnit.cpp @@ -170,10 +170,16 @@ namespace armarx bool doCalculation = false; { - ScopedLock lock(accessMutex); - - doCalculation = requested && newTargetSet; - newTargetSet = false; + ScopedTryLock lock(accessMutex); + if (lock.owns_lock()) + { + doCalculation = requested && newTargetSet; + newTargetSet = false; + } + else + { + return; + } }