The open source OpenXR runtime
0
fork

Configure Feed

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

d/na: 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
3bf927f0 2e55c54b

+3 -7
+3 -7
src/xrt/drivers/nreal_air/na_hmd.c
··· 318 318 319 319 os_mutex_lock(&hmd->device_mutex); 320 320 update_fusion_locked(hmd, sample, timestamp_ns); 321 - 322 - // We have no tracking, don't return a position. 323 - rel.pose.orientation = hmd->fusion.rot; 321 + rel.pose.orientation = hmd->fusion.rot; // We have no tracking, don't return a position. 322 + os_mutex_unlock(&hmd->device_mutex); 324 323 325 324 m_relation_history_push(hmd->relation_hist, &rel, timestamp_ns); 326 - os_mutex_unlock(&hmd->device_mutex); 327 325 } 328 326 329 327 static uint32_t ··· 1063 1061 U_ZERO(&relation); // Clear out the relation. 1064 1062 relation.relation_flags = flags; 1065 1063 1066 - os_mutex_lock(&hmd->device_mutex); 1067 1064 m_relation_history_get(hmd->relation_hist, at_timestamp_ns, &relation); 1068 - os_mutex_unlock(&hmd->device_mutex); 1069 - 1070 1065 relation.relation_flags = flags; // Needed after history_get 1066 + 1071 1067 *out_relation = relation; 1072 1068 1073 1069 // Make sure that the orientation is valid.