Use Nadav's idea of iterating over the list and selecting wait records that fit the available units.
c240daa semaphore: add support for multiple units in wait() and post()
core/semaphore.cc | 39 ++++++++++++++++++++-------------------
include/osv/semaphore.hh | 7 ++++---
2 files changed, 24 insertions(+), 22 deletions(-)
Upstream: github.com