mirror of
https://github.com/golang/go
synced 2024-11-22 00:04:41 -07: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
@ -9,8 +9,14 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var stop = make(chan bool, 1)
|
||||||
|
|
||||||
func perpetuumMobile() {
|
func perpetuumMobile() {
|
||||||
go perpetuumMobile()
|
select {
|
||||||
|
case <-stop:
|
||||||
|
default:
|
||||||
|
go perpetuumMobile()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStopTheWorldDeadlock(t *testing.T) {
|
func TestStopTheWorldDeadlock(t *testing.T) {
|
||||||
@ -29,4 +35,5 @@ func TestStopTheWorldDeadlock(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
go perpetuumMobile()
|
go perpetuumMobile()
|
||||||
<-compl
|
<-compl
|
||||||
|
stop <- true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user