• Ian Lance Taylor's avatar
    io: Avoid race condition in pipe. · 7c1be45f
    Ian Lance Taylor authored
    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
    7c1be45f
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
pkg Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...