This commit is contained in:
Timur A. Fatkhullin
2025-08-21 03:47:53 +03:00
parent 99a28d87ec
commit 33002f1711
8 changed files with 469 additions and 19 deletions

View File

@@ -387,13 +387,15 @@ public:
return MccTelemetryErrorCode::ERROR_NULLPTR;
}
std::unique_lock thread_lock(*_updateMutex);
std::unique_lock ulock(*_updateMutex);
auto res = _updateCondVar->wait_for(thread_lock, timeout, [this]() { return _updated; });
auto res = _updateCondVar->wait_for(ulock, timeout, [this]() { return _updated; });
if (res == std::cv_status::timeout) {
return MccTelemetryErrorCode::ERROR_DATA_TIMEOUT;
}
std::lock_guard thread_lock{*_updateMutex};
if (!_lastUpdateError) {
mcc_copy_telemetry_data(_data, tdata);
}
@@ -424,7 +426,7 @@ public:
{
std::lock_guard lock{*_updateMutex};
return _setTargetFunc();
return _setTargetFunc(pt);
}