From: Ian Lance Taylor Date: Thu, 7 Dec 2017 00:24:10 +0000 (-0800) Subject: runtime: sleep longer in dieFromSignal on Darwin X-Git-Tag: go1.10beta1~9 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0ec59e4c087e8d23715abe896a8c409c99bb989a;p=gostls13.git runtime: sleep longer in dieFromSignal on Darwin Fixes #20315 Change-Id: I5d5c82f10902b59168fc0cca0af50286843df55d Reviewed-on: https://go-review.googlesource.com/82375 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index 2cd3d71800..ac191f302f 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -432,6 +432,14 @@ func dieFromSignal(sig uint32) { osyield() osyield() + // On Darwin we may still fail to die, because raise sends the + // signal to the whole process rather than just the current thread, + // and osyield just sleeps briefly rather than letting all other + // threads run. See issue 20315. Sleep longer. + if GOOS == "darwin" { + usleep(100) + } + // If we are still somehow running, just exit with the wrong status. exit(2) }