runtime: delay exiting while panic is running deferred functions

Try to avoid a race between the main goroutine exiting and a panic
occurring. Don't try too hard, to avoid hanging.

Updates #3934
Fixes #20018

Change-Id: I57a02b6d795d2a61f1cadd137ce097145280ece7
Reviewed-on: https://go-review.googlesource.com/41052
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Ian Lance Taylor 2017-04-19 07:32:34 -07:00
parent 3c745d750e
commit 2d86f49428
5 changed files with 87 additions and 4 deletions

View file

@ -720,7 +720,6 @@ var (
allm *m
allp [_MaxGomaxprocs + 1]*p
gomaxprocs int32
panicking uint32
ncpu int32
forcegc forcegcstate
sched schedt