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

Method thread

test/rrd/async_scope.cpp:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 static size_t const dynamic_thread_count = 1;
30
31 void thread(unsigned)
32 {
33 exec::single_thread_context ctx;
34 ex::scheduler auto sch = ctx.get_scheduler();
35
36 exec::async_scope scope;
37 std::atomic_bool produced{false};
38 ex::sender auto begin = ex::schedule(sch);
39 {
40 ex::sender auto ftr = scope.spawn_future(begin | ex::then([&]() { produced.store(true); }));
41 (void) ftr;
42 }
43 ex::sync_wait(scope.on_empty() | ex::then([&]() { RL_ASSERT(produced.load()); }));
44 }
45};
46
47struct attach_async_scope_future : rl::test_suite<attach_async_scope_future, 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