MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / thread

Method thread

test/rrd/async_scope.cpp:51–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 static size_t const dynamic_thread_count = 1;
50
51 void thread(unsigned)
52 {
53 exec::single_thread_context ctx;
54 ex::scheduler auto sch = ctx.get_scheduler();
55
56 exec::async_scope scope;
57 std::atomic_bool produced{false};
58 ex::sender auto begin = ex::schedule(sch);
59 ex::sender auto ftr = scope.spawn_future(begin | ex::then([&]() { produced.store(true); }));
60 ex::sender auto ftr_then = std::move(ftr) | ex::then([&] { RL_ASSERT(produced.load()); });
61 ex::sync_wait(ex::when_all(scope.on_empty(), std::move(ftr_then)));
62 }
63};
64
65struct async_scope_future_set_result : rl::test_suite<async_scope_future_set_result, 1>

Callers

nothing calls this directly

Calls 7

thenFunction · 0.85
spawn_futureMethod · 0.80
on_emptyMethod · 0.80
scheduleFunction · 0.50
get_schedulerMethod · 0.45
storeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected