]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: stop deadlock test properly (fix arm5 build)
authorRuss Cox <rsc@golang.org>
Fri, 22 Apr 2011 19:22:11 +0000 (15:22 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 22 Apr 2011 19:22:11 +0000 (15:22 -0400)
TBR=r
CC=golang-dev
https://golang.org/cl/4446058

src/pkg/runtime/proc_test.go

index f5449440a8d3817555a5184e2f87a52f71b24ccc..5caaf69cd68247779e11943435347eb01e44ea6f 100644 (file)
@@ -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
 }