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 <bsiegert@gmail.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Michael Pratt 2023-09-08 17:59:02 -04:00 committed by Gopher Robot
parent 972fc055eb
commit 298e848864

View file

@ -316,7 +316,8 @@ func minit() {
//go:nosplit
func unminit() {
unminitSignals()
getg().m.procid = 0
// Don't clear procid, it is used by locking (semawake), and locking
// must continue working after unminit.
}
// Called from exitm, but not from drop, to undo the effect of thread-owned