From: Russ Cox Date: Fri, 22 Apr 2011 19:22:11 +0000 (-0400) Subject: runtime: stop deadlock test properly (fix arm5 build) X-Git-Tag: weekly.2011-04-27~63 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=781df132f9332d30e788057fd9037627ae798d0f;p=gostls13.git runtime: stop deadlock test properly (fix arm5 build) TBR=r CC=golang-dev https://golang.org/cl/4446058 --- diff --git a/src/pkg/runtime/proc_test.go b/src/pkg/runtime/proc_test.go index f5449440a8..5caaf69cd6 100644 --- a/src/pkg/runtime/proc_test.go +++ b/src/pkg/runtime/proc_test.go @@ -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 }