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

Method thread

test/rrd/async_scope.cpp:111–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 static size_t const dynamic_thread_count = 1;
110
111 void thread(unsigned)
112 {
113 exec::single_thread_context ctx;
114 ex::scheduler auto sch = ctx.get_scheduler();
115
116 if constexpr (test_case == 0)
117 {
118 exec::async_scope scope;
119 ex::sender auto begin = ex::schedule(sch);
120 ex::sender auto ftr = scope.spawn_future(scope.spawn_future(begin));
121 scope.request_stop();
122 ex::sync_wait(ex::when_all(scope.on_empty(), std::move(ftr)));
123 }
124 else
125 {
126 exec::async_scope scope;
127 ex::sender auto begin = ex::schedule(sch);
128 {
129 // Drop the future on the floor
130 ex::sender auto ftr = scope.spawn_future(scope.spawn_future(begin));
131 }
132 scope.request_stop();
133 ex::sync_wait(scope.on_empty());
134 }
135 }
136};
137
138auto main() -> int

Callers

nothing calls this directly

Calls 5

spawn_futureMethod · 0.80
on_emptyMethod · 0.80
scheduleFunction · 0.50
get_schedulerMethod · 0.45
request_stopMethod · 0.45

Tested by

no test coverage detected