Skip to content

Commit

Permalink
http2: fix CloseNotify data race
Browse files Browse the repository at this point in the history
Fixes golang/go#17868

Change-Id: I7f9d85f404198d68757d7ca5bb8b1e7aafaafa8b
Reviewed-on: https://go-review.googlesource.com/33013
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Tom Bergan <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
bradfitz committed Nov 9, 2016
1 parent 40d3034 commit 9ef2211
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2276,8 +2276,9 @@ func (w *responseWriter) CloseNotify() <-chan bool {
if ch == nil {
ch = make(chan bool, 1)
rws.closeNotifierCh = ch
cw := rws.stream.cw
go func() {
rws.stream.cw.Wait() // wait for close
cw.Wait() // wait for close
ch <- true
}()
}
Expand Down

0 comments on commit 9ef2211

Please sign in to comment.