From 55a54691f931db749e8ddb399b4a55880fa8c642 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 13 Feb 2012 23:06:21 -0500 Subject: [PATCH] runtime: use startpanic so that only one thread handles an incoming SIGQUIT Typing ^\ delivers the SIGQUIT to all threads, it appears. R=golang-dev, r, iant CC=golang-dev https://golang.org/cl/5657044 --- src/pkg/runtime/signal_darwin_386.c | 4 +--- src/pkg/runtime/signal_darwin_amd64.c | 4 +--- src/pkg/runtime/signal_freebsd_386.c | 4 +--- src/pkg/runtime/signal_freebsd_amd64.c | 4 +--- src/pkg/runtime/signal_linux_386.c | 4 +--- src/pkg/runtime/signal_linux_amd64.c | 4 +--- src/pkg/runtime/signal_netbsd_386.c | 4 +--- src/pkg/runtime/signal_netbsd_amd64.c | 4 +--- src/pkg/runtime/signal_openbsd_386.c | 4 +--- src/pkg/runtime/signal_openbsd_amd64.c | 4 +--- 10 files changed, 10 insertions(+), 30 deletions(-) diff --git a/src/pkg/runtime/signal_darwin_386.c b/src/pkg/runtime/signal_darwin_386.c index 803bd242f30..1844f68a634 100644 --- a/src/pkg/runtime/signal_darwin_386.c +++ b/src/pkg/runtime/signal_darwin_386.c @@ -92,9 +92,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG){ runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_darwin_amd64.c b/src/pkg/runtime/signal_darwin_amd64.c index 0c954294a58..32c73081c11 100644 --- a/src/pkg/runtime/signal_darwin_amd64.c +++ b/src/pkg/runtime/signal_darwin_amd64.c @@ -102,9 +102,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG){ runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_freebsd_386.c b/src/pkg/runtime/signal_freebsd_386.c index b07ead62e8d..80da95d98ac 100644 --- a/src/pkg/runtime/signal_freebsd_386.c +++ b/src/pkg/runtime/signal_freebsd_386.c @@ -89,9 +89,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_freebsd_amd64.c b/src/pkg/runtime/signal_freebsd_amd64.c index 2a686096818..e4307682f4c 100644 --- a/src/pkg/runtime/signal_freebsd_amd64.c +++ b/src/pkg/runtime/signal_freebsd_amd64.c @@ -97,9 +97,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_linux_386.c b/src/pkg/runtime/signal_linux_386.c index b43dbc1121c..b154ad88725 100644 --- a/src/pkg/runtime/signal_linux_386.c +++ b/src/pkg/runtime/signal_linux_386.c @@ -85,9 +85,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_linux_amd64.c b/src/pkg/runtime/signal_linux_amd64.c index 551744b78d5..14095ba61cd 100644 --- a/src/pkg/runtime/signal_linux_amd64.c +++ b/src/pkg/runtime/signal_linux_amd64.c @@ -95,9 +95,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_netbsd_386.c b/src/pkg/runtime/signal_netbsd_386.c index 739b359ee61..39d829484de 100644 --- a/src/pkg/runtime/signal_netbsd_386.c +++ b/src/pkg/runtime/signal_netbsd_386.c @@ -85,9 +85,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_netbsd_amd64.c b/src/pkg/runtime/signal_netbsd_amd64.c index e71f23551da..8b4f624e7cb 100644 --- a/src/pkg/runtime/signal_netbsd_amd64.c +++ b/src/pkg/runtime/signal_netbsd_amd64.c @@ -94,9 +94,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_openbsd_386.c b/src/pkg/runtime/signal_openbsd_386.c index 739b359ee61..39d829484de 100644 --- a/src/pkg/runtime/signal_openbsd_386.c +++ b/src/pkg/runtime/signal_openbsd_386.c @@ -85,9 +85,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig); diff --git a/src/pkg/runtime/signal_openbsd_amd64.c b/src/pkg/runtime/signal_openbsd_amd64.c index e71f23551da..8b4f624e7cb 100644 --- a/src/pkg/runtime/signal_openbsd_amd64.c +++ b/src/pkg/runtime/signal_openbsd_amd64.c @@ -94,9 +94,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) return; Throw: - if(runtime·panicking) // traceback already printed - runtime·exit(2); - runtime·panicking = 1; + runtime·startpanic(); if(sig < 0 || sig >= NSIG) runtime·printf("Signal %d\n", sig);