aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-10-18 12:11:43 -0400
committerMichael Pratt <mpratt@google.com>2022-10-18 20:58:37 +0000
commit1f068f0dc7bc997446a7aac44cfc70746ad918e0 (patch)
tree18641c5f4a37a7b0784a581c078a43f691e307ba /src
parente252dcf9d38ce9192bccacb7e33867cbfbd22b6c (diff)
downloadgo-1f068f0dc7bc997446a7aac44cfc70746ad918e0.tar.xz
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 <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/sys_darwin.go1
-rw-r--r--src/runtime/sys_openbsd2.go1
2 files changed, 2 insertions, 0 deletions
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