mirror of
https://github.com/golang/go.git
synced 2025-05-30 11:51:34 +00:00
runtime: clear procid in unminit
Extra Ms can move between system threads. needm will reinitialize procid (via minit) on the new thread, but leaving a stale procid behind after dropm can be misleading if printing the M early in needm for debugging. Change-Id: I668891971a0baeab31170d1e40a97126416e7379 Reviewed-on: https://go-review.googlesource.com/c/go/+/526118 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
f25ca8b33d
commit
4be921d888
@ -231,6 +231,7 @@ func minit() {
|
||||
// Called from dropm to undo the effect of an minit.
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -183,6 +183,7 @@ func minit() {
|
||||
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -344,6 +344,7 @@ func unminit() {
|
||||
if !(GOOS == "ios" && GOARCH == "arm64") {
|
||||
unminitSignals()
|
||||
}
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -211,6 +211,7 @@ func minit() {
|
||||
//go:nosplit
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -328,6 +328,7 @@ func minit() {
|
||||
//go:nosplit
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -420,6 +420,7 @@ func minit() {
|
||||
//go:nosplit
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -316,6 +316,7 @@ func minit() {
|
||||
//go:nosplit
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -187,6 +187,7 @@ func minit() {
|
||||
//go:nosplit
|
||||
func unminit() {
|
||||
unminitSignals()
|
||||
getg().m.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
@ -1010,6 +1010,8 @@ func unminit() {
|
||||
mp.thread = 0
|
||||
}
|
||||
unlock(&mp.threadLock)
|
||||
|
||||
mp.procid = 0
|
||||
}
|
||||
|
||||
// Called from exitm, but not from drop, to undo the effect of thread-owned
|
||||
|
Loading…
x
Reference in New Issue
Block a user