mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
70f441bc49
commit
0ec59e4c08
1 changed files with 8 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue