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

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

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

Visibility: public

Requested revision: 3320e6a1ae453d40dd78ff3abf6c8543bec2555d

Requested commit: 3320e6a1ae453d40dd78ff3abf6c8543bec2555d

Commit: 3320e6a1ae453d40dd78ff3abf6c8543bec2555d

Tree: d067055e1fd09de5a21f2d0aff8b04475a2ab6e1

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

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

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