Skip to content

Commit

Permalink
Expose race in asyn_scope::request_stop
Browse files Browse the repository at this point in the history
  • Loading branch information
ccotter committed Sep 17, 2024
1 parent fbd384d commit fe8718b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/exec/test_type_async_scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,15 @@ namespace {
stdexec::sync_wait(scope.on_empty());
expect_empty(scope);
}

SECTION("request_stop nested spawn_future") {
exec::static_thread_pool ctx{1};
exec::async_scope scope;
ex::sender auto begin = ex::schedule(sch);
ex::sender auto ftr = scope.spawn_future(scope.spawn_future(begin));
scope.request_stop();
stdexec::sync_wait(ex::when_all(scope.on_empty(), std::move(ftr)));
// Verify the program finishes without crashing
}
}
} // namespace

0 comments on commit fe8718b

Please sign in to comment.