aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libutil/async-semaphore.cc
AgeCommit message (Collapse)Author
2024-09-26libutil: add an async semaphore implementationeldritch horrors
like a normal semaphore, but with awaitable acquire actions. this is primarily intended as an intermediate concurrency limiting device in the Worker code, but it may find other uses over time. we do not use std::counting_semaphore as a base because the counter of that is not inspectable as will be needed for Worker. we also do not need atomic operations for cross-thread consistency since we don't have multiple threads (thanks to kj event loops being confined to a single thread) Change-Id: Ie2bcb107f3a2c0185138330f7cbba4cec6cbdd95