From: Michael Pratt Date: Tue, 18 Oct 2022 16:11:43 +0000 (-0400) Subject: runtime: throw in unreachable exitThread X-Git-Tag: go1.20rc1~594 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1f068f0dc7bc997446a7aac44cfc70746ad918e0;p=gostls13.git runtime: throw in unreachable exitThread Several OSes don't ever reach exitThread, On AIX, Plan9, Solaris, and Windows, we throw if this function is accidentally reached. Do the same on Darwin and OpenBSD for consistency. Change-Id: Icd189b11179755a28b3ec48b267349c57facbf24 Reviewed-on: https://go-review.googlesource.com/c/go/+/443717 Reviewed-by: Cherry Mui Reviewed-by: Michael Knyszek TryBot-Result: Gopher Robot Run-TryBot: Michael Pratt --- diff --git a/src/runtime/sys_darwin.go b/src/runtime/sys_darwin.go index 88af894409..18b0490ebb 100644 --- a/src/runtime/sys_darwin.go +++ b/src/runtime/sys_darwin.go @@ -476,6 +476,7 @@ func pthread_cond_signal_trampoline() // Not used on Darwin, but must be defined. func exitThread(wait *atomic.Uint32) { + throw("exitThread") } //go:nosplit diff --git a/src/runtime/sys_openbsd2.go b/src/runtime/sys_openbsd2.go index f755cd528c..49bad8ed1d 100644 --- a/src/runtime/sys_openbsd2.go +++ b/src/runtime/sys_openbsd2.go @@ -250,6 +250,7 @@ func sigaltstack_trampoline() // Not used on OpenBSD, but must be defined. func exitThread(wait *atomic.Uint32) { + throw("exitThread") } //go:nosplit