mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
f82956b85b
commit
fc8eb264bb
2 changed files with 5 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue