sustrik / libdill

Structured concurrency in C
MIT License
1.68k stars 156 forks source link

Simple async_await #202

Open GwenNelson opened 4 years ago

GwenNelson commented 4 years ago

Just wondering if something like this could be integrated into the library, it basically allows to await on a coroutine and then get the return value.

My implementation is a quick hack as a proof of concept, see this gist:

https://gist.github.com/GwenNelson/ae315c9aaadf9d4e354b0222958aed84

sustrik commented 4 years ago

What's the point? If the parent coroutine waits for the child coroutine, it can as well do the work in normal synchronous function, no?