go/src
Kirill Smelkov d296c3235d io: fix PipeWriter.Close to wake up Writes
Since commit cc62bed0 (CL 994043) the pipe deadlock when doing
Read+Close or Write+Close on same end was fixed, alas with test for
Read+Close case only.

Then commit 6d6f3381 (CL 4252057) made a thinko: in the writer path
p.werr is checked for != nil and then err is set but there is no break
from waiting loop unlike break is there in similar condition for reader.
Together with having only Read+Close case tested that made it to leave
reintroduced Write+Close deadlock unnoticed.

Fix it.

Implicitly this also fixes net.Pipe to conform to semantic of net.Conn
interface where Close is documented to unblock any blocked Read or Write
operations.

No test added to net/ since net.Pipe tests are "Assuming that the
underlying io.Pipe implementation is solid and we're just testing the
net wrapping". The test added in this patch should be enough to cover
the breakage.

Fixes #18401
Updates #18170

Change-Id: I9e9460b3fd7d220bbe60b726accf86f352aed8d4
Reviewed-on: https://go-review.googlesource.com/34637
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-12-21 15:08:26 +00:00
..
archive Revert: "archive/zip: handle mtime in NTFS/UNIX/ExtendedTS extra fields" 2016-12-20 01:39:35 +00:00
bufio bufio: remove unnecessary "continue" 2016-10-24 14:49:44 +00:00
builtin
bytes all: make copyright headers consistent with one space after period 2016-11-04 20:46:25 +00:00
cmd cmd/vet: avoid crash in cgo test on recursive type 2016-12-21 04:29:31 +00:00
compress compress/flate: add examples 2016-11-12 18:42:35 +00:00
container
context all: make spelling consistent 2016-12-08 23:22:37 +00:00
crypto crypto/x509: fix spelling/grammar in comments 2016-12-20 04:56:53 +00:00
database/sql database/sql: do not store Tx options in Context 2016-12-14 18:13:13 +00:00
debug cmd/objdump: copy gosym.PCValue into internal package 2016-12-01 18:20:04 +00:00
encoding all: make spelling consistent 2016-12-08 23:22:37 +00:00
errors
expvar
flag flag: arrange for FlagSet.Usage to be non-nil by default 2016-10-26 16:13:40 +00:00
fmt fmt: undo clearflags in catchPanic after error message has been printed 2016-12-11 21:59:59 +00:00
go go/parser: fix reference in ParseExprFrom docs 2016-12-21 05:37:31 +00:00
hash
html html/template: lock in application/json as valid JS test 2016-12-04 03:59:31 +00:00
image image/png: implement grayscale transparency. 2016-10-28 02:10:13 +00:00
index/suffixarray
internal internal/pprof/profile: parse mutex profile including comments 2016-11-29 18:04:37 +00:00
io io: fix PipeWriter.Close to wake up Writes 2016-12-21 15:08:26 +00:00
log all: don't call t.Fatal from a goroutine 2016-11-15 15:13:48 +00:00
math crypto/*: document use or non-use of constant-time algorithms 2016-12-07 16:34:50 +00:00
mime mime/multipart: test for overreading on a stream 2016-11-07 19:32:11 +00:00
net net: make InterfaceByIndex return a consistent name on solaris 2016-12-21 01:19:02 +00:00
os os: must fixup path when 248 bytes long 2016-12-13 03:21:00 +00:00
path path/filepath: deprecate HasPrefix 2016-12-16 22:30:12 +00:00
plugin cmd/go, plugin: disable plugins on darwin 2016-12-15 05:46:20 +00:00
reflect runtime: clean up and improve reflect.methodValue comments 2016-12-19 21:02:53 +00:00
regexp regexp: avoid alloc in QuoteMeta when not quoting 2016-10-19 07:09:08 +00:00
runtime runtime: avoid incorrect panic when a signal arrives during STW 2016-12-20 17:27:47 +00:00
sort sort: add Slice example 2016-12-01 05:43:05 +00:00
strconv
strings bytes, strings: update s390x code to match amd64 changes 2016-11-02 15:56:24 +00:00
sync runtime/internal/atomic: crash on unaligned 64-bit ops on 32-bit MIPS 2016-11-22 02:05:07 +00:00
syscall runtime, syscall: update openbsd for changes to syskill 2016-12-12 01:30:39 +00:00
testing Revert "testing: add T.Context method" 2016-12-09 04:04:11 +00:00
text text/template: handle option missingkey=error consistently 2016-11-18 15:56:02 +00:00
time time: parse WITA timezone correctly 2016-12-12 20:14:12 +00:00
unicode unicode/utf8: optimize ValidRune 2016-10-26 23:02:52 +00:00
unsafe unsafe: remove incorrect type conversion in docs 2016-11-07 18:54:14 +00:00
vendor/golang_org/x vendor/golang_org/x/crypto/chacha20poly1305: revendor to pick up fix for #18154 2016-12-02 06:00:05 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash all: make copyright headers consistent with one space after period 2016-11-04 20:46:25 +00:00
iostest.bash
make.bash
make.bat
make.rc build: fix cross-compile on Plan 9 2016-11-22 01:32:28 +00:00
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc