# std.Io.Threaded: fix bad use of AlertableSyscall · gitcafe/zig

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

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

Visibility: public

Requested revision: 2fb224cb845c18044186c1348ca9a1b2a3152948

Requested commit: 2fb224cb845c18044186c1348ca9a1b2a3152948

Commit: 2fb224cb845c18044186c1348ca9a1b2a3152948

Tree: 00fbfb365add8541befdb97de2c42ee05eca8ad7

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Io.Threaded: fix bad use of AlertableSyscall

The defer would cause two problems:
1. keeping the state active during call to NtCancelIoFile
2. invalid state transition. after canceled is returned from
   checkCancel, new status is already canceled. calling finish after
   that is illegal.

```

## Parents

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

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