diff options
author | Ian Lance Taylor <iant@golang.org> | 2017-12-06 16:24:10 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2017-12-07 00:56:23 +0000 |
commit | 0ec59e4c087e8d23715abe896a8c409c99bb989a (patch) | |
tree | 0f146270921d54e56be85afa7736264da86e59b5 | |
parent | 70f441bc49afa4e9d10c27d7ed5733c4df7bddd3 (diff) | |
download | go-0ec59e4c087e8d23715abe896a8c409c99bb989a.tar.gz go-0ec59e4c087e8d23715abe896a8c409c99bb989a.zip |
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 <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r-- | src/runtime/signal_unix.go | 8 |
1 files changed, 8 insertions, 0 deletions
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) } |