aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-04-11 14:20:54 -0700
committerIan Lance Taylor <iant@golang.org>2019-10-23 07:43:18 +0000
commitab3f1a23b6c29a110423d6fd6bf2b01fa62a6fb2 (patch)
tree38e2a45179cd9748a8bad2099f32fbe3dc9a2e37 /src/runtime/runtime2.go
parentc824420d4744bd3e11128c000d88c24859602d46 (diff)
downloadgo-ab3f1a23b6c29a110423d6fd6bf2b01fa62a6fb2.tar.xz
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>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index b57ae75baf..2e6c3d9d79 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -613,6 +613,9 @@ type p struct {
// such as timerModifying.
adjustTimers uint32
+ // Race context used while executing timer functions.
+ timerRaceCtx uintptr
+
pad cpu.CacheLinePad
}