]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] runtime: add race annotations to cbs.lock
authorMichael Pratt <mpratt@google.com>
Tue, 28 Jun 2022 20:32:50 +0000 (16:32 -0400)
committerHeschi Kreinick <heschi@google.com>
Wed, 6 Jul 2022 20:57:57 +0000 (20:57 +0000)
commitae2dfcc1c8891a7610f2d31d457427b71ed9c6e0
treee5980a6d656cc066d59af659f58373d3930a7284
parentfc07039e2339a80f53e7db5e214b5be504bc1df6
[release-branch.go1.17] runtime: add race annotations to cbs.lock

cbs.lock protects a map. The map implementation is race instrumented
regardless of which package is it called from.

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

compileCallback is used during initialization before the P is available,
at which point raceacquire will crash during a racecallback to get the
race proc. Thus we skip instrumentation until scheduler initialization
is complete.

Fixes #53612.
For #50249.

Change-Id: Ie49227c9e9210ffbf0aee65f86f2b7b6a2f64638
Reviewed-on: https://go-review.googlesource.com/c/go/+/414518
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
(cherry picked from commit 20760cff001e9acc05627dfeab42ea50b57920e6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/415197
src/runtime/syscall_windows.go