1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:57:57 -07:00

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
This commit is contained in:
Russ Cox 2012-02-13 23:06:21 -05:00
parent 0995aba983
commit 55a54691f9
10 changed files with 10 additions and 30 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);