d/hdk: initialized thread helper

Fixes assert in debug mode.
This commit is contained in:
Christoph Haag 2023-01-08 23:41:46 +01:00
parent 6bd921b390
commit 01dd02dc83

View file

@ -476,9 +476,16 @@ hdk_device_create(struct os_hid_device *dev, enum HDK_VARIANT variant)
// XRT_DISTORTION_MODEL_PANOTOOLS;
// }
int ret = os_thread_helper_init(&hd->imu_thread);
if (ret != 0) {
HDK_ERROR(hd, "Failed to start imu thread!");
hdk_device_destroy((struct xrt_device *)hd);
return 0;
}
if (hd->dev) {
// Mutex before thread.
int ret = os_mutex_init(&hd->lock);
ret = os_mutex_init(&hd->lock);
if (ret != 0) {
HDK_ERROR(hd, "Failed to init mutex!");
hdk_device_destroy(&hd->base);