]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix invariant comment in chan.go
authorRuss Cox <rsc@golang.org>
Thu, 20 Oct 2016 13:11:20 +0000 (09:11 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 24 Oct 2016 15:59:28 +0000 (15:59 +0000)
Change-Id: Ic6317f186d0ee68ab1f2d15be9a966a152f61bfb
Reviewed-on: https://go-review.googlesource.com/31610
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/chan.go

index 712ad8cef95a29e5184874c1ed5249f4df255abe..261d37d4eea6b00a9fb5baf7b684ee91958f0804 100644 (file)
@@ -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"