08 | Once:一个简约而不简单的并发原语 https://time.geekbang.org/column/article/301113
type Once struct { done uint32}
func (o *Once) Do(f func()) { if !atomic.CompareAndSwapUint32(&o.done, 0, 1) { return } f()}
翻译
搜索
复制