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

Method thread

test/rrd/async_scope.cpp:69–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 static size_t const dynamic_thread_count = 1;
68
69 void thread(unsigned)
70 {
71 struct throwing_copy
72 {
73 throwing_copy() = default;
74
75 throwing_copy(throwing_copy const &)
76 {
77 throw std::logic_error("");
78 }
79 };
80
81 exec::single_thread_context ctx;
82 ex::scheduler auto sch = ctx.get_scheduler();
83
84 exec::async_scope scope;
85 ex::sender auto begin = ex::schedule(sch);
86 ex::sender auto ftr = scope.spawn_future(begin | ex::then([] { return throwing_copy(); }));
87 bool threw = false;
88 STDEXEC_TRY
89 {
90 ex::sync_wait(std::move(ftr));
91 RL_ASSERT(false);
92 }
93 STDEXEC_CATCH(std::logic_error const &)
94 {
95 threw = true;

Callers

nothing calls this directly

Calls 5

thenFunction · 0.85
spawn_futureMethod · 0.80
throwing_copyClass · 0.70
scheduleFunction · 0.50
get_schedulerMethod · 0.45

Tested by

no test coverage detected