Skip to content

Commit

Permalink
Make async_rw_mutex test use let_value instead of then + sync_wait
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Aug 14, 2024
1 parent 9948496 commit d06c9ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ namespace hpx::experimental {
template <typename Env>
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
sender const&, Env)
sender const&, Env const&)
-> hpx::execution::experimental::completion_signatures<
hpx::execution::experimental::set_value_t(access_type),
hpx::execution::experimental::set_error_t(
Expand Down
9 changes: 9 additions & 0 deletions libs/core/synchronization/tests/unit/async_rw_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,18 @@ void submit_senders(Executor&& exec, Senders& senders)
{
for (auto& sender : senders)
{
// Original code uses sync_wait inside an hpx scheduler. Sync_wait completely
// blocks the thread with std synchronization primitives which causes it to hang
#ifdef HPX_HAVE_STDEXEC
hpx::execution::experimental::start_detached(
hpx::execution::experimental::schedule(exec) |
hpx::execution::experimental::let_value(
[s = std::move(sender)]() mutable { return std::move(s); }));
#else
execute(exec, [sender = std::move(sender)]() mutable {
sync_wait(std::move(sender));
});
#endif
}
}

Expand Down

0 comments on commit d06c9ad

Please sign in to comment.