The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

t/hand: Reduce relation history lock contention

Relation history was being accessed guarded by an external lock in a couple of
places. This is redundant since its implementation already defines an internal
lock.

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
d4863389 c6ca7d23

+6 -4
+6 -4
src/xrt/tracking/hand/t_hand_tracking_async.c
··· 129 129 130 130 for (int i = 0; i < 2; i++) { 131 131 hta->present.hands[i] = hta->working.hands[i]; 132 + } 132 133 134 + os_mutex_unlock(&hta->present.mutex); 135 + 136 + for (int i = 0; i < 2; i++) { 133 137 struct xrt_space_relation wrist_rel = 134 138 hta->working.hands[i].values.hand_joint_set_default[XRT_HAND_JOINT_WRIST].relation; 135 139 ··· 144 148 &wrist_rel, // 145 149 hta->working.timestamp); // 146 150 } 147 - 148 - os_mutex_unlock(&hta->present.mutex); 149 151 150 152 hta->hand_tracking_work_active = false; 151 153 ··· 280 282 return; 281 283 } 282 284 285 + os_mutex_unlock(&hta->present.mutex); 286 + 283 287 double prediction_offset_ns = (double)hta->prediction_offset_ms.val * (double)U_TIME_1MS_IN_NS; 284 288 285 289 desired_timestamp_ns += (uint64_t)prediction_offset_ns; 286 290 287 291 struct xrt_space_relation predicted_wrist; 288 292 m_relation_history_get(hta->present.relation_hist[idx], desired_timestamp_ns, &predicted_wrist); 289 - 290 - os_mutex_unlock(&hta->present.mutex); 291 293 292 294 struct xrt_space_relation latest_wrist = 293 295 latest_hand.values.hand_joint_set_default[XRT_HAND_JOINT_WRIST].relation;