MCPcopy Create free account
hub / github.com/Tom94/tev / enqueueCoroutineToDetachedThread

Function enqueueCoroutineToDetachedThread

include/tev/Task.h:75–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73};
74
75inline auto enqueueCoroutineToDetachedThread() noexcept {
76 struct Awaiter {
77 bool await_ready() const noexcept { return false; }
78 // Suspend and enqueue coroutine continuation onto the thread
79 void await_suspend(std::coroutine_handle<> coroutine) noexcept { std::thread{coroutine}.detach(); }
80 void await_resume() const noexcept {}
81 };
82 return Awaiter{};
83}
84
85template <typename data_t> class TaskPromiseBase {
86public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected