]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add race annotations to cbs.lock
authorMichael Pratt <mpratt@google.com>
Tue, 28 Jun 2022 20:32:50 +0000 (16:32 -0400)
committerMichael Pratt <mpratt@google.com>
Wed, 29 Jun 2022 20:12:49 +0000 (20:12 +0000)
commit20760cff001e9acc05627dfeab42ea50b57920e6
tree94c5c910e52855bd286c49ef3b6995780dedc5cc
parente6c0546c54f6f3fa7c6cb5002ecc839bc89d5d20
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 #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>
src/runtime/syscall_windows.go