playground/socket: make output/end race less likely

This doesn't fix the race; doing that would require a bit of a redesign.
Since GopherCon is this week, just put in this stop-gap measure for now.

Update golang/go#11534

Change-Id: Ied6c5dd52778534a7a08b5ba3fa15c0352a65646
Reviewed-on: https://go-review.googlesource.com/11886
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Andrew Gerrand 2015-07-06 06:46:14 +10:00
parent 997b3545fd
commit e645bbf898

View File

@ -316,7 +316,7 @@ func (p *process) end(err error) {
m.Body = err.Error()
}
// Wait for any outstanding reads to finish (potential race here).
time.AfterFunc(msgDelay, func() { p.out <- m })
time.AfterFunc(4*msgDelay, func() { p.out <- m })
}
// cmd builds an *exec.Cmd that writes its standard output and error to the