]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: document tie-breaking in Select
authorRuss Cox <rsc@golang.org>
Tue, 19 Feb 2013 15:13:53 +0000 (10:13 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 19 Feb 2013 15:13:53 +0000 (10:13 -0500)
The exact words are taken from the spec.

Fixes some confusion on golang-nuts.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7353044

src/pkg/reflect/value.go

index 2e2c807ea08e4d9ec7dacc462f7df218404fcc3b..65311a6a42e799e5958f600a5c2e95105b55a66f 100644 (file)
@@ -1791,8 +1791,9 @@ type SelectCase struct {
 }
 
 // Select executes a select operation described by the list of cases.
-// Like the Go select statement, it blocks until one of the cases can
-// proceed and then executes that case. It returns the index of the chosen case
+// Like the Go select statement, it blocks until at least one of the cases
+// can proceed, makes a uniform pseudo-random choice,
+// and then executes that case. It returns the index of the chosen case
 // and, if that case was a receive operation, the value received and a
 // boolean indicating whether the value corresponds to a send on the channel
 // (as opposed to a zero value received because the channel is closed).