aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2019-04-15 21:46:43 -0400
committerAustin Clements <austin@google.com>2019-10-25 16:59:39 +0000
commitfc8eb264bba88b9e4eb85fa7560817abb25767f4 (patch)
tree476b7857c584dc2d1da59a5d84670410b49aa14b /src/runtime/runtime2.go
parentf82956b85bf7087b79b006018829423166b12afc (diff)
downloadgo-fc8eb264bba88b9e4eb85fa7560817abb25767f4.tar.xz
runtime: ensure _Grunning Gs have a valid g.m and g.m.p
We already claim on the documentation for _Grunning that this is case, but execute transitions to _Grunning before assigning g.m. Fix this and make the documentation even more explicit. For #10958, #24543, but also a good cleanup. Change-Id: I1eb0108e7762f55cfb0282aca624af1c0a15fe56 Reviewed-on: https://go-review.googlesource.com/c/go/+/201440 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index aebc9af06f..c5023027be 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -40,7 +40,7 @@ const (
// _Grunning means this goroutine may execute user code. The
// stack is owned by this goroutine. It is not on a run queue.
- // It is assigned an M and a P.
+ // It is assigned an M and a P (g.m and g.m.p are valid).
_Grunning // 2
// _Gsyscall means this goroutine is executing a system call.