Skip to content

Commit

Permalink
fix encapsulation in thread pool sch env
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Jun 4, 2024
1 parent 8945172 commit a8d51fe
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ namespace hpx::execution::experimental::detail {

struct env
{
thread_pool_bulk_sender const& snd;
std::decay_t<Sender> const& pred_snd;
thread_pool_policy_scheduler<Policy> const& sch;

// clang-format off
template <typename CPO,
Expand All @@ -695,26 +696,25 @@ namespace hpx::execution::experimental::detail {
tag,
env const& e) noexcept
{
return tag(hpx::execution::experimental::get_env(e.snd.sender));
return tag(hpx::execution::experimental::get_env(e.pred_snd));
}

friend constexpr auto tag_invoke(
hpx::execution::experimental::get_completion_scheduler_t<
hpx::execution::experimental::set_value_t>,
env const& e) noexcept
{
return e.snd.scheduler;
return e.sch;
}
};

friend struct env;
// It may be also be correct to forward the entire env of the
// pred. sender.
friend constexpr auto tag_invoke(
hpx::execution::experimental::get_env_t,
thread_pool_bulk_sender const& s) noexcept
{
return env{s};
return env{s.sender, s.scheduler};
}
#else
template <typename Env>
Expand Down

0 comments on commit a8d51fe

Please sign in to comment.