]> Cypherpunks repositories - gostls13.git/commit
internal/poll, os: cancel pending I/O when closing pipes on Windows
authorWèi Cōngruì <crvv.mail@gmail.com>
Mon, 4 Mar 2019 10:07:07 +0000 (10:07 +0000)
committerIan Lance Taylor <iant@golang.org>
Tue, 19 Mar 2019 04:20:08 +0000 (04:20 +0000)
commitd227a0811b76791fad04eeba35cf2794a719d610
treebd5fa7ad3ce4c8354b3971102563d833925c6095
parent205d62d58b16afbb4e6232a0591e3e8f4153a591
internal/poll, os: cancel pending I/O when closing pipes on Windows

When closing a pipe, use CancelIoEx to cancel pending I/O.
This makes concurrent Read and Write calls return os.ErrClosed.

This change also enables some pipe tests on Windows.

Fixes #28477
Fixes #25835

Change-Id: If52bb7d80895763488a61632e4682a78336e8420
Reviewed-on: https://go-review.googlesource.com/c/go/+/164721
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/internal/poll/fd_windows.go
src/internal/poll/sendfile_windows.go
src/os/file_windows.go
src/os/pipe_test.go