2 #include "prepared_coro.h"
44 class suspend :
public trace::suspend_always{
56 std::queue<prepared_coro> q;
60 auto n = std::move(q.front());
64 local_queue =
nullptr;
75 return local_queue !=
nullptr;
94 static thread_local std::queue<prepared_coro> *local_queue;
98 inline thread_local std::queue<prepared_coro> *suspend::local_queue =
nullptr;
std::coroutine_handle symmetric_transfer()
release handle to be used in function await_suspend()
contains prepared coroutine (prepared to run)
static void await_suspend(std::coroutine_handle<> h)
this function is static.
Suspend current coroutine and switch to another coroutine ready to run.
friend bool in_cooperative_mode()
Determines, whether current thread is in cooperative mode.
friend void enqueue(prepared_coro c)
Enqueue coroutine to the queue in the cooperative mode.
void resume(std::coroutine_handle<> h) noexcept
Record resumption of an coroutine.