Skip to content

BUG: DeviceClient should be updated in its own thread only

Andrew Wilson requested to merge andrew.wilson/iMSTK:ControlUpdateFix into master

A call to DeviceClient::update was being performed by both TrackingDeviceControl::updateTrackingData in the SceneManager thread and HapticDeviceManager::update in the HapticDeviceManager thread. Can easily cause race conditions (and sneaky memory issues) if not careful in these functions.

This does not cause issues with OpenHaptics as no updating of state actually occurs in update, it uses hdScheduleAsync to start its own thread instead. So an extra thread is spawned by OpenHaptics along with our update thread that is not used. This should be later fixed, only one separate thread is needed for haptics (possibly reinvestigate the performance implications of using hdScheduleSync).

Merge request reports