]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add race annotations to metricsSema
authorMichael Pratt <mpratt@google.com>
Tue, 28 Jun 2022 19:17:12 +0000 (15:17 -0400)
committerDavid Chase <drchase@google.com>
Wed, 29 Jun 2022 16:30:19 +0000 (16:30 +0000)
commitd6481d5b9662b29453004204746945a93a6b4eb2
tree188370350e876c226664389ebe1d4cfca5475d1b
parentbd1783e812bf10f5829b742135ef886623cccc5c
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 #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>
src/runtime/export_test.go
src/runtime/metrics.go