Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions include/exec/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,15 @@ namespace experimental::execution
template <class _ParentPromise>
constexpr explicit __default_task_context_impl(_ParentPromise& __parent) noexcept
{
if constexpr (__with_affinity && __parent_promise_has_start_scheduler<_ParentPromise>())
if constexpr (__with_affinity)
{
// get_start_scheduler is used here to get the parent's "current" scheduler,
// which is the one on which this task has been started (i.e., co_await-ed).
auto __parent_sched = get_start_scheduler(get_env(__parent));
this->__scheduler_ = __parent_sched;
if constexpr (__parent_promise_has_start_scheduler<_ParentPromise>())
{
// get_start_scheduler is used here to get the parent's "current" scheduler,
// which is the one on which this task has been started (i.e., co_await-ed).
auto __parent_sched = get_start_scheduler(get_env(__parent));
this->__scheduler_ = __parent_sched;
}
Comment thread
ericniebler marked this conversation as resolved.
}
}

Expand Down
Loading