mirror of
https://github.com/golang/go
synced 2024-11-22 01:04:40 -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"
|
||||
)
|
||||
|
||||
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…
Reference in New Issue
Block a user