From 781df132f9332d30e788057fd9037627ae798d0f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 22 Apr 2011 15:22:11 -0400 Subject: [PATCH] runtime: stop deadlock test properly (fix arm5 build) TBR=r CC=golang-dev https://golang.org/cl/4446058 --- src/pkg/runtime/proc_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/proc_test.go b/src/pkg/runtime/proc_test.go index f5449440a8d..5caaf69cd68 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 }