diff options
| author | Ian Lance Taylor <iant@golang.org> | 2022-11-16 14:19:47 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-11-17 00:13:03 +0000 |
| commit | b7662047aedc5f2c512911eb59d514ce75b16e18 (patch) | |
| tree | 17d533d4eb097ce68ec3ab97003741b12d7034d1 /src/path/filepath | |
| parent | a2d8157a7ecc8c7a91c93182ae4778aef505677e (diff) | |
| download | go-b7662047aedc5f2c512911eb59d514ce75b16e18.tar.xz | |
net: change resolverConfig.dnsConfig to an atomic.Pointer
We were using a RWMutex RLock around a single memory load,
which is not a good use of a RWMutex--it introduces extra work
for the RLock but contention around a single memory load is unlikely.
And, the tryUpdate method was not acquiring the mutex anyhow.
The new atomic.Pointer type is type-safe and easy to use correctly
for a simple use-case like this.
Change-Id: Ib3859c03414c44d2e897f6d15c92c8e4b5c81a11
Reviewed-on: https://go-review.googlesource.com/c/go/+/451416
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/path/filepath')
0 files changed, 0 insertions, 0 deletions
