aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2024-09-11 13:33:42 +0700
committerGopher Robot <gobot@golang.org>2024-09-11 17:05:32 +0000
commit820329508aa55ccbb90996e8840acb5859f84557 (patch)
tree8586c0d6bcbf10b7ae2c9ba3a579411e3e7577ee /src/runtime/testdata
parent26aa8d6eb8faf05bbbb87a4f531e3e0fe4feed44 (diff)
downloadgo-820329508aa55ccbb90996e8840acb5859f84557.tar.xz
runtime: Goexit on C-created thread report more useful error message
This reverts CL 609296, with the fix for failing builders. Fixes #68275 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-nocgo,gotip-darwin-amd64-nocgo,gotip-linux-ppc64_power10,gotip-linux-ppc64_power8 Change-Id: I0f539ee7b0be720642eee8885946edccd9c6e04e Reviewed-on: https://go-review.googlesource.com/c/go/+/612335 Reviewed-by: Tim King <taking@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprogcgo/callback.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprogcgo/callback.go b/src/runtime/testdata/testprogcgo/callback.go
index 319572fe10..39993f13a6 100644
--- a/src/runtime/testdata/testprogcgo/callback.go
+++ b/src/runtime/testdata/testprogcgo/callback.go
@@ -38,10 +38,21 @@ import (
func init() {
register("CgoCallbackGC", CgoCallbackGC)
+ register("CgoToGoCallGoexit", CgoToGoCallGoexit)
}
+func CgoToGoCallGoexit() {
+ goexit = true
+ C.foo()
+}
+
+var goexit = false
+
//export go_callback
func go_callback() {
+ if goexit {
+ runtime.Goexit()
+ }
if e := extraMInUse.Load(); e == 0 {
fmt.Printf("in callback extraMInUse got %d want >0\n", e)
os.Exit(1)