]> Cypherpunks repositories - gostls13.git/commit
os: fix race between file I/O and Close
authorIan Lance Taylor <iant@golang.org>
Tue, 25 Apr 2017 04:49:26 +0000 (21:49 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 25 Apr 2017 13:58:24 +0000 (13:58 +0000)
commit11c7b4491bd2cd1deb7b50433f431be9ced330db
treec07895d060a30d16a0ed8d08a3ca3da8e0cf4d84
parent9459c03b29937d236a8b61e452cb02d01c7b8559
os: fix race between file I/O and Close

Now that the os package uses internal/poll on Unix and Windows systems,
it can rely on internal/poll reference counting to ensure that the
file descriptor is not closed until all I/O is complete.

That was already working. This CL completes the job by not trying to
modify the Sysfd field when it might still be used by the I/O routines.

Fixes #7970

Change-Id: I7a3daa1a6b07b7345bdce6f0cd7164bd4eaee952
Reviewed-on: https://go-review.googlesource.com/41674
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/dist/test.go
src/os/dir_windows.go
src/os/file.go
src/os/file_posix.go
src/os/file_unix.go
src/os/file_windows.go
src/os/pipe_test.go
src/os/stat_windows.go
src/os/types_unix.go