diff options
| author | Michael Pratt <mpratt@google.com> | 2022-10-18 12:11:43 -0400 |
|---|---|---|
| committer | Michael Pratt <mpratt@google.com> | 2022-10-18 20:58:37 +0000 |
| commit | 1f068f0dc7bc997446a7aac44cfc70746ad918e0 (patch) | |
| tree | 18641c5f4a37a7b0784a581c078a43f691e307ba /src | |
| parent | e252dcf9d38ce9192bccacb7e33867cbfbd22b6c (diff) | |
| download | go-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.go | 1 | ||||
| -rw-r--r-- | src/runtime/sys_openbsd2.go | 1 |
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 |
