Commit 7c616b38 authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: always set *received in chanrecv.

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
parent f6d0e811
...@@ -366,6 +366,8 @@ asynch: ...@@ -366,6 +366,8 @@ asynch:
if(selected != nil) { if(selected != nil) {
runtime·unlock(c); runtime·unlock(c);
*selected = false; *selected = false;
if(received != nil)
*received = false;
return; return;
} }
sg = allocsg(c); sg = allocsg(c);
...@@ -521,7 +523,7 @@ runtime·selectnbrecv(byte *v, Hchan *c, bool selected) ...@@ -521,7 +523,7 @@ runtime·selectnbrecv(byte *v, Hchan *c, bool selected)
// compiler implements // compiler implements
// //
// select { // select {
// case v = <-c: // case v, ok = <-c:
// ... foo // ... foo
// default: // default:
// ... bar // ... bar
...@@ -529,7 +531,7 @@ runtime·selectnbrecv(byte *v, Hchan *c, bool selected) ...@@ -529,7 +531,7 @@ runtime·selectnbrecv(byte *v, Hchan *c, bool selected)
// //
// as // as
// //
// if c != nil && selectnbrecv(&v, c) { // if c != nil && selectnbrecv2(&v, &ok, c) {
// ... foo // ... foo
// } else { // } else {
// ... bar // ... bar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment