]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: don't clear procid on netbsd
authorMichael Pratt <mpratt@google.com>
Fri, 8 Sep 2023 21:59:02 +0000 (17:59 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 11 Sep 2023 16:15:14 +0000 (16:15 +0000)
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>
src/runtime/os_netbsd.go

index c5d7b4b978c8d067795fd7bbd4770d2bb39c0c24..7cbba48194a8ac31650f1ba30745cf295b40632f 100644 (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