From: Russ Cox Date: Thu, 20 Oct 2016 13:11:20 +0000 (-0400) Subject: runtime: fix invariant comment in chan.go X-Git-Tag: go1.8beta1~686 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=39690beb5885d378d98117c3d57b494e97f16eea;p=gostls13.git runtime: fix invariant comment in chan.go Change-Id: Ic6317f186d0ee68ab1f2d15be9a966a152f61bfb Reviewed-on: https://go-review.googlesource.com/31610 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- diff --git a/src/runtime/chan.go b/src/runtime/chan.go index 712ad8cef9..261d37d4ee 100644 --- a/src/runtime/chan.go +++ b/src/runtime/chan.go @@ -7,10 +7,16 @@ package runtime // This file contains the implementation of Go channels. // Invariants: -// At least one of c.sendq and c.recvq is empty. +// At least one of c.sendq and c.recvq is empty, +// except for the case of an unbuffered channel with a single goroutine +// blocked on it for both sending and receiving using a select statement, +// in which case the length of c.sendq and c.recvq is limited only by the +// size of the select statement. +// // For buffered channels, also: // c.qcount > 0 implies that c.recvq is empty. // c.qcount < c.dataqsiz implies that c.sendq is empty. + import ( "runtime/internal/atomic" "unsafe"