mirror of
https://github.com/golang/go
synced 2024-11-24 11:00:08 -07:00
runtime: don't terminate locked OS threads on Plan 9
CL 46037 and CL 46038 implemented termination of locked OS threads when the goroutine exits. However, this behavior leads to crashes of Go programs using runtime.LockOSThread on Plan 9. This is notably the case of the os/exec and net packages. This change disables termination of locked OS threads on Plan 9. Updates #22227. Change-Id: If9fa241bff1c0b68e7e9e321e06e5203b3923212 Reviewed-on: https://go-review.googlesource.com/71230 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d155b32f8d
commit
f4faca6013
@ -2671,7 +2671,9 @@ func goexit0(gp *g) {
|
|||||||
|
|
||||||
// Return to mstart, which will release the P and exit
|
// Return to mstart, which will release the P and exit
|
||||||
// the thread.
|
// the thread.
|
||||||
gogo(&_g_.m.g0.sched)
|
if GOOS != "plan9" { // See golang.org/issue/22227.
|
||||||
|
gogo(&_g_.m.g0.sched)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
schedule()
|
schedule()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user