aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 661dc0f1ca..aae30dc2a8 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -4175,6 +4175,11 @@ func goexit1() {
// goexit continuation on g0.
func goexit0(gp *g) {
+ gdestroy(gp)
+ schedule()
+}
+
+func gdestroy(gp *g) {
mp := getg().m
pp := mp.p.ptr()
@@ -4211,7 +4216,7 @@ func goexit0(gp *g) {
if GOARCH == "wasm" { // no threads yet on wasm
gfput(pp, gp)
- schedule() // never returns
+ return
}
if mp.lockedInt != 0 {
@@ -4234,7 +4239,6 @@ func goexit0(gp *g) {
mp.lockedExt = 0
}
}
- schedule()
}
// save updates getg().sched to refer to pc and sp so that a following