]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] runtime: add race annotations to metricsSema
authorMichael Pratt <mpratt@google.com>
Tue, 28 Jun 2022 19:17:12 +0000 (15:17 -0400)
committerHeschi Kreinick <heschi@google.com>
Wed, 6 Jul 2022 19:34:57 +0000 (19:34 +0000)
commit2f43de6da0898d3f7031dee0b7a80a219df3dfee
tree2ce12ae29b4bc7680616bdb821e8507e15ef1120
parent1872c338a3fc9a91df1abdfe9f9d94fe2b907719
[release-branch.go1.18] runtime: add race annotations to metricsSema

metricsSema protects the metrics map. The map implementation is race
instrumented regardless of which package is it called from.

semacquire/semrelease are not automatically race instrumented, so we can
trigger race false positives without manually annotating our lock
acquire and release.

See similar instrumentation on trace.shutdownSema and reflectOffs.lock.

Fixes #53590.
For #53542.

Change-Id: Ia3fd239ac860e037d09c7cb9c4ad267391e70705
Reviewed-on: https://go-review.googlesource.com/c/go/+/414517
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
(cherry picked from commit d6481d5b9662b29453004204746945a93a6b4eb2)
Reviewed-on: https://go-review.googlesource.com/c/go/+/415195
src/runtime/export_test.go
src/runtime/metrics.go