Skip to content

Commit

Permalink
Merge df0b0ae into ff04f4b
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg authored Dec 12, 2022
2 parents ff04f4b + df0b0ae commit 5c6bb31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,12 @@ namespace pika::ensure_started_detail {
state->start();
}

ensure_started_sender_type(ensure_started_sender_type const&) = default;
ensure_started_sender_type& operator=(
ensure_started_sender_type const&) = default;
ensure_started_sender_type(ensure_started_sender_type&&) = default;
ensure_started_sender_type& operator=(
ensure_started_sender_type&&) = default;
ensure_started_sender_type(ensure_started_sender_type const&) = delete;
ensure_started_sender_type& operator=(
ensure_started_sender_type const&) = delete;

template <typename Receiver>
struct operation_state
Expand Down
33 changes: 0 additions & 33 deletions libs/pika/execution/tests/unit/algorithm_ensure_started.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,39 +168,6 @@ int main()
PIKA_TEST(set_error_called);
}

// We don't test internal implementation details of the P2300 reference
// implementation
#if !defined(PIKA_HAVE_P2300_REFERENCE_IMPLEMENTATION)
// Chained ensure_started calls do not create new shared states
{
std::atomic<bool> receiver_set_value_called{false};
auto s1 = ex::just() | ex::ensure_started();
auto s2 = ex::ensure_started(s1);
PIKA_TEST_EQ(s1.state, s2.state);
auto s3 = ex::ensure_started(std::move(s2));
PIKA_TEST_EQ(s1.state, s3.state);
auto f = [] {};
auto r = callback_receiver<decltype(f)>{f, receiver_set_value_called};
auto os = ex::connect(std::move(s3), std::move(r));
ex::start(os);
PIKA_TEST(receiver_set_value_called);
}

{
std::atomic<bool> receiver_set_value_called{false};
auto s1 = ex::just(42) | ex::ensure_started();
auto s2 = ex::ensure_started(s1);
PIKA_TEST_EQ(s1.state, s2.state);
auto s3 = ex::ensure_started(std::move(s2));
PIKA_TEST_EQ(s1.state, s3.state);
auto f = [](int x) { PIKA_TEST_EQ(x, 42); };
auto r = callback_receiver<decltype(f)>{f, receiver_set_value_called};
auto os = ex::connect(std::move(s3), std::move(r));
ex::start(os);
PIKA_TEST(receiver_set_value_called);
}
#endif

// It's allowed to discard the sender from ensure_started
{
ex::just() | ex::ensure_started();
Expand Down

0 comments on commit 5c6bb31

Please sign in to comment.