]> Cypherpunks repositories - gostls13.git/commit
net: use chan bool instead of chan *netFD to avoid cycle
authorRuss Cox <rsc@golang.org>
Tue, 6 Apr 2010 23:50:27 +0000 (16:50 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 6 Apr 2010 23:50:27 +0000 (16:50 -0700)
commitcaa149f73da050377c8009ae4b7a565d6a36b3b9
tree3114823a6eb027bedda96633e6f1576c41d073f9
parent6431b984db2cf902e344285173cad793512923da
net: use chan bool instead of chan *netFD to avoid cycle

The cycle is *netFD -> cw chanl *netFD in struct ->
same *netFD in channel read buffer.

Because channels are finalized, the cycle makes them
uncollectable.  A better fix is to make channels not
finalized anymore, and that will happen, but this is
an easy, reasonable workaround until then.

Another good fix would be to zero the channel receive
buffer entry after the receive.  That too will happen.

R=r
CC=golang-dev
https://golang.org/cl/875043
src/pkg/net/fd.go