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

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

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

Visibility: public

Requested revision: ab1268efc33aa94854d7fb7aa312a079ded0706d

Requested commit: ab1268efc33aa94854d7fb7aa312a079ded0706d

Commit: ab1268efc33aa94854d7fb7aa312a079ded0706d

Tree: 3b5026607b310a570c76583cdac160a756038780

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

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

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