summaryrefslogtreecommitdiff
path: root/test/stress/runstress.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/stress/runstress.go')
-rw-r--r--test/stress/runstress.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/stress/runstress.go b/test/stress/runstress.go
index b5adf6a4a..76ab2a8b4 100644
--- a/test/stress/runstress.go
+++ b/test/stress/runstress.go
@@ -114,11 +114,16 @@ func stressExec() {
}
}
-func ringf(in <-chan int, out chan<- int, donec chan<- bool) {
+func ringf(in <-chan int, out chan<- int, donec chan bool) {
for {
- n := <-in
+ var n int
+ select {
+ case <-donec:
+ return
+ case n = <-in:
+ }
if n == 0 {
- donec <- true
+ close(donec)
return
}
out <- n - 1