From 0bb916b9b07158ed1901c161ca4434d375c01a35 Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 5 Sep 2024 14:37:53 +0300 Subject: [PATCH 1/2] fix order of calls --- src/rpp/rpp/schedulers/current_thread.hpp | 4 ++-- src/rpp/rpp/schedulers/new_thread.hpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rpp/rpp/schedulers/current_thread.hpp b/src/rpp/rpp/schedulers/current_thread.hpp index b0d60c43e..3fa99c84b 100644 --- a/src/rpp/rpp/schedulers/current_thread.hpp +++ b/src/rpp/rpp/schedulers/current_thread.hpp @@ -129,8 +129,8 @@ namespace rpp::schedulers } continue; } - - get_queue()->emplace(top->handle_advanced_call(res.value()), std::move(top)); + const auto tp = top->handle_advanced_call(res.value()); + get_queue()->emplace(tp, std::move(top)); } } break; diff --git a/src/rpp/rpp/schedulers/new_thread.hpp b/src/rpp/rpp/schedulers/new_thread.hpp index 9fa379bb8..9a46ed9b9 100644 --- a/src/rpp/rpp/schedulers/new_thread.hpp +++ b/src/rpp/rpp/schedulers/new_thread.hpp @@ -108,8 +108,9 @@ namespace rpp::schedulers { if (res->can_run_immediately() && !state->has_fresh_data.load()) continue; - - state->queue.emplace(top->handle_advanced_call(res.value()), std::move(top)); + + const auto tp = top->handle_advanced_call(res.value()); + state->queue.emplace(tp, std::move(top)); } } break; From 71c826869aea8427255c5d96d3503cb8a1815abc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:38:07 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/rpp/rpp/schedulers/new_thread.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpp/rpp/schedulers/new_thread.hpp b/src/rpp/rpp/schedulers/new_thread.hpp index 9a46ed9b9..c48925071 100644 --- a/src/rpp/rpp/schedulers/new_thread.hpp +++ b/src/rpp/rpp/schedulers/new_thread.hpp @@ -108,7 +108,7 @@ namespace rpp::schedulers { if (res->can_run_immediately() && !state->has_fresh_data.load()) continue; - + const auto tp = top->handle_advanced_call(res.value()); state->queue.emplace(tp, std::move(top)); }