net, os: don't wait for Close in blocking mode

Updates #7970
Updates #21856
Updates #23111

Change-Id: I0cd0151fcca740c40c3c976f941b04e98e67b0bf
Reviewed-on: https://go-review.googlesource.com/83715
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Ian Lance Taylor 2017-12-13 06:32:06 -08:00
parent d0b2467966
commit 0f3ab149ec
4 changed files with 93 additions and 4 deletions

View file

@ -66,7 +66,7 @@ func (f *File) Fd() uintptr {
// opened in blocking mode. The File will continue to work,
// but any blocking operation will tie up a thread.
if f.nonblock {
syscall.SetNonblock(f.pfd.Sysfd, false)
f.pfd.SetBlocking()
}
return uintptr(f.pfd.Sysfd)