# std.Io.Threaded: fix the cancellation race · gitcafe/zig

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

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

Visibility: public

Requested revision: 29e418cbfb3d5e5800ac2ad267b21cf2b8942c2c

Requested commit: 29e418cbfb3d5e5800ac2ad267b21cf2b8942c2c

Commit: 29e418cbfb3d5e5800ac2ad267b21cf2b8942c2c

Tree: fd28b3a438e564c13137d5e178248e3087c35328

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Io.Threaded: fix the cancellation race

Now, before a syscall is entered, beginSyscall is called, which may
return error.Canceled. After syscall returns, whether error or success,
endSyscall is called. If the syscall returns EINTR then checkCancel is
called.

`cancelRequested` is removed from the std.Io VTable for now, with plans
to replace it with a more powerful API that allows protection against
cancellation requests.

closes #25751

```

## Parents

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

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