mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: no deadlock error if buildmode=c-archive or c-shared
Change-Id: I4ee6dac32bd3759aabdfdc92b235282785fbcca9 Reviewed-on: https://go-review.googlesource.com/9083 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
a13cf8c104
commit
725aa3451a
1 changed files with 7 additions and 0 deletions
|
|
@ -2711,6 +2711,13 @@ func incidlelocked(v int32) {
|
|||
// Check for deadlock situation.
|
||||
// The check is based on number of running M's, if 0 -> deadlock.
|
||||
func checkdead() {
|
||||
// For -buildmode=c-shared or -buildmode=c-archive it's OK if
|
||||
// there are no running goroutines. The calling program is
|
||||
// assumed to be running.
|
||||
if islibrary || isarchive {
|
||||
return
|
||||
}
|
||||
|
||||
// If we are dying because of a signal caught on an already idle thread,
|
||||
// freezetheworld will cause all running threads to block.
|
||||
// And runtime will essentially enter into deadlock state,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue