Commit b57afc2f authored by Ken Thompson's avatar Ken Thompson

another try at clearing

channel recv data.

R=rsc
CC=golang-dev
https://golang.org/cl/896041
parent dec248c6
......@@ -781,21 +781,19 @@ loop:
sel, c, cas, cas->send, o);
if(!cas->send) {
if(cas->u.elemp != nil) {
if(cas->u.elemp != nil)
c->elemalg->copy(c->elemsize, cas->u.elemp, sg->elem);
c->elemalg->copy(c->elemsize, sg->elem, nil);
}
}
freesg(c, sg);
goto retc;
asyncrecv:
// can receive from buffer
if(cas->u.elemp != nil) {
if(cas->u.elemp != nil)
c->elemalg->copy(c->elemsize, cas->u.elemp, c->recvdataq->elem);
c->elemalg->copy(c->elemsize, c->recvdataq->elem, nil);
}
c->recvdataq = c->recvdataq->link;
c->qcount--;
sg = dequeue(&c->sendq, c);
......@@ -824,10 +822,9 @@ syncrecv:
// can receive from sleeping sender (sg)
if(debug)
printf("syncrecv: sel=%p c=%p o=%d\n", sel, c, o);
if(cas->u.elemp != nil) {
if(cas->u.elemp != nil)
c->elemalg->copy(c->elemsize, cas->u.elemp, sg->elem);
c->elemalg->copy(c->elemsize, sg->elem, nil);
}
gp = sg->g;
gp->param = sg;
ready(gp);
......
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