From: David du Colombier <0intro@gmail.com> Date: Mon, 16 Oct 2017 22:31:56 +0000 (+0200) Subject: runtime: don't terminate locked OS threads on Plan 9 X-Git-Tag: go1.10beta1~684 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f4faca60135bea528a29f454876efa642b00665e;p=gostls13.git 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 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 4133b23584..48ce7d6248 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2671,7 +2671,9 @@ func goexit0(gp *g) { // Return to mstart, which will release the P and exit // the thread. - gogo(&_g_.m.g0.sched) + if GOOS != "plan9" { // See golang.org/issue/22227. + gogo(&_g_.m.g0.sched) + } } schedule() }