diff --git a/include/beman/execution/detail/schedule_from.hpp b/include/beman/execution/detail/schedule_from.hpp index 8dc26d91..47a5b763 100644 --- a/include/beman/execution/detail/schedule_from.hpp +++ b/include/beman/execution/detail/schedule_from.hpp @@ -130,15 +130,15 @@ struct impls_for<::beman::execution::detail::schedule_from_t> : ::beman::executi ::std::monostate, ::beman::execution::detail::meta::transform< ::beman::execution::detail::as_tuple_t, - ::beman::execution::detail::meta::to< - ::std::variant, - ::beman::execution::detail::meta::combine< - ::beman::execution::completion_signatures_of_t< - ::beman::execution::detail::child_type, - ::beman::execution::env_of_t>, - //-dk:TODO get proper error completion signatures - ::beman::execution::completion_signatures<::beman::execution::set_error_t( - ::std::exception_ptr)>>>>>>; + ::beman::execution::detail::meta::to<::std::variant, + ::beman::execution::detail::meta::combine< + ::beman::execution::completion_signatures_of_t< + ::beman::execution::detail::child_type, + ::beman::execution::env_of_t>, + //-dk:TODO get proper error completion signatures + ::beman::execution::completion_signatures< + ::beman::execution::set_error_t(::std::exception_ptr), + ::beman::execution::set_stopped_t()>>>>>>; return state_type(sch, receiver); }}; diff --git a/tests/beman/execution/CMakeLists.txt b/tests/beman/execution/CMakeLists.txt index 899c28d9..696ec350 100644 --- a/tests/beman/execution/CMakeLists.txt +++ b/tests/beman/execution/CMakeLists.txt @@ -12,6 +12,7 @@ list(APPEND todo exec-associate.test) list( APPEND execution_tests + issue-174.test exec-scope-counting.test exec-spawn.test exec-stop-when.test diff --git a/tests/beman/execution/issue-174.test.cpp b/tests/beman/execution/issue-174.test.cpp new file mode 100644 index 00000000..b88ba527 --- /dev/null +++ b/tests/beman/execution/issue-174.test.cpp @@ -0,0 +1,26 @@ +// tests/beman/execution/issue-174.test.cpp *-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#include + +namespace ex = beman::execution; + +namespace { +struct thread_loop : ex::run_loop { + std::thread thread{[this] { this->run(); }}; + ~thread_loop() { + this->finish(); + this->thread.join(); + } +}; +} // namespace + +int main() { + thread_loop ex_context1; + thread_loop ex_context2; + + ex::sync_wait(ex::just() | ex::then([] {}) | ex::continues_on(ex_context1.get_scheduler()) | ex::then([] {}) | + ex::continues_on(ex_context2.get_scheduler()) | ex::then([] {})); +}