Skip to content

Instantly share code, notes, and snippets.

@MBkkt
Created June 1, 2022 03:55
Show Gist options
  • Save MBkkt/24ee420d083c70c52c31fc557c9ed2eb to your computer and use it in GitHub Desktop.
Save MBkkt/24ee420d083c70c52c31fc557c9ed2eb to your computer and use it in GitHub Desktop.
blbl
bool await_ready();
... await_suspend(handle);
V await_resume();
Channel<V, 1> ch;
ch.~Channel() -- while (...) {}
V value = co_await ch.Recv();
co_await ch.Send(v);
1) void
2) bool -- true, false
3) corountine_handle -- symmetric transfer
handle.resume/destroy()
Kek kek = co_await m.lock();
auto awaiter = m.lock();
if (!awaiter.await_ready()) {
builtin_suspend(awaiter) -------> awaiter.await_suspend(previos_self)
}
awaiter.await_resume();
Mutex m
auto guard = co_await m.lock();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment