...
This commit is contained in:
@@ -521,12 +521,15 @@ public:
|
||||
{
|
||||
using intv_t = std::remove_cvref_t<decltype(_currentUpdateInterval)>;
|
||||
|
||||
_internalUpdatingStopSource = std::stop_source{}; // reset state
|
||||
|
||||
*_internalUpdating = true;
|
||||
|
||||
_internalUpdatingFuture = std::async(
|
||||
std::launch::async,
|
||||
[this](std::stop_token stop_token) -> error_t {
|
||||
while (!stop_token.stop_requested()) {
|
||||
// while (!stop_token.stop_requested()) {
|
||||
while (true) {
|
||||
_lastUpdateError = updateTelemetryData(defaultInternalUpdateTimeout);
|
||||
if (_lastUpdateError) {
|
||||
*_internalUpdating = false;
|
||||
@@ -593,7 +596,9 @@ public:
|
||||
|
||||
*_isDataUpdated = false;
|
||||
|
||||
std::future<error_t> update_ft = std::async(std::launch::async, _updateFunc, stop_source.get_token());
|
||||
// std::future<error_t> update_ft = std::async(std::launch::async, _updateFunc, stop_source.get_token());
|
||||
std::future<error_t> update_ft =
|
||||
std::async(std::launch::async, _updateFunc, _internalUpdatingStopSource.get_token());
|
||||
auto status = update_ft.wait_for(timeout);
|
||||
|
||||
if (status == std::future_status::ready) {
|
||||
|
||||
Reference in New Issue
Block a user