Commit 781df132 authored by Russ Cox's avatar Russ Cox

runtime: stop deadlock test properly (fix arm5 build)

TBR=r
CC=golang-dev
https://golang.org/cl/4446058
parent d5864454
...@@ -9,8 +9,14 @@ import ( ...@@ -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) { ...@@ -29,4 +35,5 @@ func TestStopTheWorldDeadlock(t *testing.T) {
}() }()
go perpetuumMobile() go perpetuumMobile()
<-compl <-compl
stop <- true
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment