On Tue, Sep 25, 2018 at 6:15 PM, <avt...@gmail.com> wrote: > > I am learning sync.map recently, but the implemention of tryStore func makes > me confused, > why not use the code below instead > > > > func (e *entry) tryStore(i *interface{}) bool { > for { > p = atomic.LoadPointer(&e.p) > if p == expunged { > return false > } > if atomic.CompareAndSwapPointer(&e.p, p, unsafe.Pointer(i)) { > return true > } > } > }
As far as I can tell, you're right. I'll send a patch. Thanks. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.