diff --git a/src/pkg/sync/once.go b/src/pkg/sync/once.go index 04b714a3e74..1699e86a9eb 100644 --- a/src/pkg/sync/once.go +++ b/src/pkg/sync/once.go @@ -38,6 +38,6 @@ func (o *Once) Do(f func()) { defer o.m.Unlock() if o.done == 0 { f() - atomic.CompareAndSwapUint32(&o.done, 0, 1) + atomic.StoreUint32(&o.done, 1) } }