From 2916bd45418369f5ef3f0db50359daf80d75e3f8 Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Mon, 12 Oct 2026 16:02:30 +0300 Subject: [PATCH] it seems now there is no deadlocks --- include/mcc/mcc_telemetry.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/mcc/mcc_telemetry.h b/include/mcc/mcc_telemetry.h index 183d71a..0457760 100644 --- a/include/mcc/mcc_telemetry.h +++ b/include/mcc/mcc_telemetry.h @@ -292,7 +292,8 @@ public: _updatingStopSource.get_token(), hardware, pcm); - _updateFunc = [hw = hardware, pcm_ptr = pcm, this](telemetry_data_t* tdata) { + _updateFunc = [hw=hardware, pcm_ptr=pcm, this](telemetry_data_t* tdata) mutable -> error_t { + _tdataPtr = tdata; if (_tdataPtr != nullptr && hw && pcm_ptr) { _lastUpdateError = MccTelemetryErrorCode::ERROR_OK; @@ -365,6 +366,8 @@ public: } else { _lastUpdateError = MccTelemetryErrorCode::ERROR_NULLPTR; } + + return _lastUpdateError; }; } @@ -432,8 +435,8 @@ public: // 12.10.2026: try to catch dead-lock // use here mutex-free non-timedout implementation - _updateFunc(tdata); - return _lastUpdateError; + return _updateFunc(tdata); +// tdata = _tdataPtr; _tdataPtr = tdata;