# std.Io.Threaded.batchWait better fix for any_done · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0ac63ff9dffa7311cc539b52e037bd38d2019683)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0ac63ff9dffa7311cc539b52e037bd38d2019683

Requested commit: 0ac63ff9dffa7311cc539b52e037bd38d2019683

Commit: 0ac63ff9dffa7311cc539b52e037bd38d2019683

Tree: c747a83be993768349a99aca4db5c2dbc6e3e67d

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Io.Threaded.batchWait better fix for any_done

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.

```

## Parents

- [a635d62a6b01e9b5b50f5256bef445f5f438a399](https://git.cafe/gitcafe/zig/commit/a635d62a6b01e9b5b50f5256bef445f5f438a399?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0ac63ff9dffa7311cc539b52e037bd38d2019683?format=markdown)
