]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: throw in unreachable exitThread
authorMichael Pratt <mpratt@google.com>
Tue, 18 Oct 2022 16:11:43 +0000 (12:11 -0400)
committerMichael Pratt <mpratt@google.com>
Tue, 18 Oct 2022 20:58:37 +0000 (20:58 +0000)
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>

src/runtime/sys_darwin.go
src/runtime/sys_openbsd2.go

index 88af8944097e258657a08205d556a42c7bc0e99b..18b0490ebb41d91fe06528bc0bbac52abe259070 100644 (file)
@@ -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
index f755cd528c8fce370b6ff6249c2776d30aad91f5..49bad8ed1d68cfff7c53cc1fadb02192059ac987 100644 (file)
@@ -250,6 +250,7 @@ func sigaltstack_trampoline()
 
 // Not used on OpenBSD, but must be defined.
 func exitThread(wait *atomic.Uint32) {
+       throw("exitThread")
 }
 
 //go:nosplit