mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: stop deadlock test properly (fix arm5 build)
TBR=r CC=golang-dev https://golang.org/cl/4446058
This commit is contained in:
parent
d5864454dc
commit
781df132f9
1 changed files with 8 additions and 1 deletions
|
|
@ -9,8 +9,14 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
var stop = make(chan bool, 1)
|
||||
|
||||
func perpetuumMobile() {
|
||||
go perpetuumMobile()
|
||||
select {
|
||||
case <-stop:
|
||||
default:
|
||||
go perpetuumMobile()
|
||||
}
|
||||
}
|
||||
|
||||
func TestStopTheWorldDeadlock(t *testing.T) {
|
||||
|
|
@ -29,4 +35,5 @@ func TestStopTheWorldDeadlock(t *testing.T) {
|
|||
}()
|
||||
go perpetuumMobile()
|
||||
<-compl
|
||||
stop <- true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue