Closed lewissbaker closed 7 years ago
Bikeshedding:
wait_for()
- could be confused with waiting/sleeping for a specified time?
sync_wait()
blocking_wait()
wait()
- maybe not obvious enough that it is blocking?
Commit 3a581e633e19c1f2aeb199fd20df99cf545419f3 has added the cppcoro::sync_wait()
function.
It uses cppcoro::detail::lightweight_manual_reset_event
(added in d6f005342d889f3567ff818023610bd1aca11232) to do the blocking wait.
This uses futex()
/ WaitOnAddress()
under the hood to do the blocking-wait.
This is just waiting on some documentation in the README.
Added
lightweight_manual_reset_event
class in 278c3181a68e04a206071a4de5c2ec1f3c79d429 that should serve as a building-block for a synchronous blocking API for tasks.The implementation of
wait_for()
should then be able to attach acontinuation
to the task that callsevent.set()
when it completes and then just blocks waiting for the task to complete by callingevent.wait()
.