Skip to content

Commit

Permalink
simplify the logic inside the thread
Browse files Browse the repository at this point in the history
Co-authored-by: atzaros <128592691+atzaros@users.noreply.github.com>
  • Loading branch information
saikishor and atzaros committed May 17, 2024
1 parent 7e197cf commit 9d31eb4
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,13 @@ class AsyncFunctionHandler
std::unique_lock<std::mutex> lock(async_mtx_);
async_update_condition_.wait(
lock, [this] { return trigger_in_progress_ || async_update_stop_; });
if (async_update_stop_)
if (!async_update_stop_)
{
trigger_in_progress_ = false;
cycle_end_condition_.notify_one();
break;
async_update_return_ = async_function_(current_update_time_, current_update_period_);
}
async_update_return_ = async_function_(current_update_time_, current_update_period_);
trigger_in_progress_ = false;
}
cycle_end_condition_.notify_one();
cycle_end_condition_.notify_all();
}
});
}
Expand Down

0 comments on commit 9d31eb4

Please sign in to comment.