It is legal to call batchWait with already completed operations in the ring. In such case, we need to avoid waiting in the syscall. The any_done flag was a poor way of tracking state we already have: whether the completion queue is empty. This problem affects the posix poll implementation as well. Thanks again to jacobly for finding the problem.