Skip to content

Commit 298e848

Browse files
prattmicgopherbot
authored andcommitted
runtime: don't clear procid on netbsd
This is a partial revert of CL 526118. NetBSD uses mp.procid in locking (semawake). unminit is called surprisingly early in mexit, and there is definitely locking after that point, so it isn't safe to clear procid so early. Fixes #62524. Fixes #62531. Change-Id: Iefbef63e84fc0395e255970a301401e1187a910d Reviewed-on: https://go-review.googlesource.com/c/go/+/527057 Reviewed-by: Benny Siegert <[email protected]> Auto-Submit: Michael Pratt <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 972fc05 commit 298e848

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runtime/os_netbsd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ func minit() {
316316
//go:nosplit
317317
func unminit() {
318318
unminitSignals()
319-
getg().m.procid = 0
319+
// Don't clear procid, it is used by locking (semawake), and locking
320+
// must continue working after unminit.
320321
}
321322

322323
// Called from exitm, but not from drop, to undo the effect of thread-owned

0 commit comments

Comments
 (0)