Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 9 additions & 9 deletions include/beman/execution/detail/schedule_from.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sender>,
::beman::execution::env_of_t<Receiver>>,
//-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<Sender>,
::beman::execution::env_of_t<Receiver>>,
//-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<Receiver, sched_t, variant_t>(sch, receiver);
}};
Expand Down
1 change: 1 addition & 0 deletions tests/beman/execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions tests/beman/execution/issue-174.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// tests/beman/execution/issue-174.test.cpp *-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/execution/execution.hpp>
#include <thread>
#include <utility>

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([] {}));
}