diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2025-02-03 15:22:37 +0000 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2025-10-20 13:32:17 -0700 |
| commit | df33c170919faca6ea849ee23fb0af6971fddc5b (patch) | |
| tree | 016a6fe8af7d3ad065b18bcc3be22323f4e704fa /src/runtime/runtime2.go | |
| parent | 7503856d4072a748ac5618c6040f84a2f7ddac59 (diff) | |
| download | go-df33c170919faca6ea849ee23fb0af6971fddc5b.tar.xz | |
runtime: add _Gdeadextra status
_Gdeadextra is almost the same as _Gdead but for goroutines attached to
extra Ms. The primary difference is that it can be transitioned into a
_Gscan status, unlike _Gdead. (Why not just use _Gdead? For safety,
mostly. There's exactly one case where we're going to want to transition
_Gdead to _Gscan|_Gdead, and it's for extra Ms. It's also a bit weird to
call this state dead when it can still have a syscalling P attached to
it.)
This status is used in a follow-up change that changes entersyscall and
exitsyscall.
Change-Id: I169a4c8617aa3dc329574b829203f56c86b58169
Reviewed-on: https://go-review.googlesource.com/c/go/+/646197
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/runtime2.go')
| -rw-r--r-- | src/runtime/runtime2.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 6016c6fde0..eaf24fe908 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -90,6 +90,10 @@ const ( // _Gleaked represents a leaked goroutine caught by the GC. _Gleaked // 10 + // _Gdeadextra is a _Gdead goroutine that's attached to an extra M + // used for cgo callbacks. + _Gdeadextra // 11 + // _Gscan combined with one of the above states other than // _Grunning indicates that GC is scanning the stack. The // goroutine is not executing user code and the stack is owned @@ -108,6 +112,7 @@ const ( _Gscanwaiting = _Gscan + _Gwaiting // 0x1004 _Gscanpreempted = _Gscan + _Gpreempted // 0x1009 _Gscanleaked = _Gscan + _Gleaked // 0x100a + _Gscandeadextra = _Gscan + _Gdeadextra // 0x100b ) const ( |
