Re: [go-nuts] A question about channel

2021-09-14 Thread Ian Lance Taylor
On Tue, Sep 14, 2021 at 9:30 AM LinkinStar wrote: > > Hi golang-nuts, > When I read the source code about chan.go, I found some problems that were a > little difficult to understand. > > hchan has two function, full and empty. > > func full(c *hchan) bool { > // c.dataqsiz is immutable (never wri

[go-nuts] A question about channel

2021-09-14 Thread LinkinStar
Hi golang-nuts, When I read the source code about chan.go, I found some problems that were a little difficult to understand. hchan has two function, full and empty. func full(c *hchan) bool { // c.dataqsiz is immutable (never written after the channel is created) // so it is safe to read at any