Fix get start scheduler#102
Merged
Merged
Conversation
dietmarkuehl
requested review from
bretbrownjr,
steve-downey and
wusatosi
as code owners
July 19, 2026 16:03
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the task implementation and tests to use get_start_scheduler / set_start_scheduler semantics (and related CPOs) instead of the prior get_scheduler / set_scheduler plumbing, aligning scheduler propagation and environment querying with “start scheduler” terminology.
Changes:
- Renamed
state_basescheduler accessors/virtuals from*_schedulerto*_start_scheduler, updating derived implementations accordingly. - Updated promise/environment plumbing to expose the promise’s start scheduler through
get_start_scheduler(and updated tests to queryget_start_scheduler). - Updated awaiter rescheduling logic and tests to use
get_start_scheduler-based queries.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/beman/task/task.test.cpp | Updates scheduler affinity test to read get_start_scheduler. |
| tests/beman/task/state_base.test.cpp | Updates state_base test overrides to do_get_start_scheduler / do_set_start_scheduler. |
| tests/beman/task/promise_type.test.cpp | Updates test state overrides and query to get_start_scheduler_t. |
| tests/beman/task/promise_base.test.cpp | Updates test state overrides to do_get_start_scheduler / do_set_start_scheduler. |
| include/beman/task/detail/state.hpp | Renames scheduler virtual overrides to start-scheduler variants in the concrete state. |
| include/beman/task/detail/state_base.hpp | Renames public/virtual scheduler API to get_start_scheduler/set_start_scheduler and prefers start scheduler in from_env() with fallback to get_scheduler. |
| include/beman/task/detail/promise_type.hpp | Routes scheduler changes/reads through set_start_scheduler / get_start_scheduler. |
| include/beman/task/detail/promise_env.hpp | Updates environment queries to return the promise’s start scheduler. |
| include/beman/task/detail/awaiter.hpp | Switches awaiter rescheduling to use get_start_scheduler queries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
25
to
29
| template <typename Awaiter, | ||
| typename ParentPromise, | ||
| bool = | ||
| requires(const ParentPromise& p) { ::beman::execution::get_scheduler(::beman::execution::get_env(p)); }> | ||
| bool = requires( | ||
| const ParentPromise& p) { ::beman::execution::get_start_scheduler(::beman::execution::get_env(p)); }> | ||
| struct awaiter_op_t { |
Comment on lines
75
to
81
| if constexpr (requires { | ||
| *this->scheduler != | ||
| ::beman::execution::get_scheduler(::beman::execution::get_env(this->parent.promise())); | ||
| *this->scheduler != ::beman::execution::get_start_scheduler( | ||
| ::beman::execution::get_env(this->parent.promise())); | ||
| }) { | ||
| if (*this->scheduler != | ||
| ::beman::execution::get_scheduler(::beman::execution::get_env(this->parent.promise()))) { | ||
| ::beman::execution::get_start_scheduler(::beman::execution::get_env(this->parent.promise()))) { | ||
| this->reschedule.emplace(this->parent.promise(), this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.