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

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

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

Visibility: public

Requested revision: 1e188d790a028117440369e9638a436c0daf1b68

Requested commit: 1e188d790a028117440369e9638a436c0daf1b68

Commit: 1e188d790a028117440369e9638a436c0daf1b68

Tree: 0d5ad9469ed90a065308f50963612a34c904c5af

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

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

The defer causes 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

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

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