1
0
mirror of https://github.com/golang/go synced 2024-11-19 06:04:39 -07:00
go/src/pkg/io
Ian Lance Taylor 7c1be45f58 io: Avoid race condition in pipe.
One goroutine started up and was waiting in rw.  Then another
goroutine decided to close the pipe.  The closing goroutine
stalled calling p.io.Lock() in pipeHalf.close.  (This happened
in gccgo).  If the closing goroutine had been able to set the
ioclosed flag, it would have gone on to tell the runner that
the pipe was closed, which would then send an EINVAL to the
goroutine sleeping in rw.  Unlocking p.io before sleeping in
rw avoids the race.

R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/1682048
2010-06-30 13:14:46 -07:00
..
ioutil io/ioutil: add TempFile 2010-06-03 16:29:34 -07:00
io_test.go 1) Change default gofmt default settings for 2009-12-15 15:35:38 -08:00
io.go strings: delete Runes, Bytes 2010-02-25 16:01:29 -08:00
Makefile move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package. 2009-12-02 22:02:14 -08:00
pipe_test.go pipe: implementation #3; this time for sure! 2010-04-27 10:17:17 -07:00
pipe.go io: Avoid race condition in pipe. 2010-06-30 13:14:46 -07:00