runtime: add race detector support for new timers

Since the new timers run on g0, which does not have a race context,
we add a race context field to the P, and use that for timer functions.
This works since all timer functions are in the standard library.

Updates #27707

Change-Id: I8a5b727b4ddc8ca6fc60eb6d6f5e9819245e395b
Reviewed-on: https://go-review.googlesource.com/c/go/+/171882
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Ian Lance Taylor 2019-04-11 14:20:54 -07:00
parent c824420d47
commit ab3f1a23b6
8 changed files with 98 additions and 7 deletions

View file

@ -613,6 +613,9 @@ type p struct {
// such as timerModifying.
adjustTimers uint32
// Race context used while executing timer functions.
timerRaceCtx uintptr
pad cpu.CacheLinePad
}