sync: simplify the code with atomic.Pointer
Change-Id: I79797be6b385c9927d68350334d7f7387007085f
GitHub-Last-Rev:
3daa3b144f55f527d183d4ff35475ca4af3ee143
GitHub-Pull-Request: golang/go#65937
Reviewed-on: https://go-review.googlesource.com/c/go/+/566815
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>