Also fix comment.
The only caller of chanrecv initializes the value to false, so
this patch makes no difference at present. But it seems like
the right thing to do.
R=rsc
CC=golang-dev
https://golang.org/cl/
4312053
if(selected != nil) {
runtime·unlock(c);
*selected = false;
+ if(received != nil)
+ *received = false;
return;
}
sg = allocsg(c);
// compiler implements
//
// select {
-// case v = <-c:
+// case v, ok = <-c:
// ... foo
// default:
// ... bar
//
// as
//
-// if c != nil && selectnbrecv(&v, c) {
+// if c != nil && selectnbrecv2(&v, &ok, c) {
// ... foo
// } else {
// ... bar