[go-nuts] Re: A question about A sync.Once implementation.

2019-05-07 Thread wudi . daniel
Hi, Thanks for your reply. The second bug is a known issue, so let’s ignore that. In that case, I think function f still can only be executed once. But why does the load and store of o.done need to be done using atomic operations? I suppose there’s mutex assuring the happens-before.

Re: [go-nuts] A question about A sync.Once implementation.

2019-05-07 Thread wudi . daniel
I'm quite sorry for that. This is my first time posting code here. Here's go playground link: https://play.golang.org/p/9xVjoD7rI0F. 在 2019年5月7日星期二 UTC+8下午10:08:39,Ian Lance Taylor写道: > > On Tue, May 7, 2019 at 5:55 AM > wrote: > > > > Hi, > > I did a quiz recently, but I'm having probl