From ea2ac3fe5fb2011b077809e60bc018e0c6caa66c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 15 Jun 2016 10:36:48 -0700 Subject: [PATCH] runtime: remove useless loop from CgoCCodeSIGPROF test program I verified that the test fails if I undo the change that it tests for. Updates #14732. Change-Id: Ib30352580236adefae946450ddd6cd65a62b7cdf Reviewed-on: https://go-review.googlesource.com/24151 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Mikio Hara --- src/runtime/testdata/testprogcgo/aprof.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/runtime/testdata/testprogcgo/aprof.go b/src/runtime/testdata/testprogcgo/aprof.go index b4b71f2861..aabca9e1eb 100644 --- a/src/runtime/testdata/testprogcgo/aprof.go +++ b/src/runtime/testdata/testprogcgo/aprof.go @@ -30,19 +30,17 @@ func GoNop() {} func CgoCCodeSIGPROF() { c := make(chan bool) go func() { - for { - <-c - start := time.Now() - for i := 0; i < 1e7; i++ { - if i%1000 == 0 { - if time.Since(start) > time.Second { - break - } + <-c + start := time.Now() + for i := 0; i < 1e7; i++ { + if i%1000 == 0 { + if time.Since(start) > time.Second { + break } - C.GoNop() } - c <- true + C.GoNop() } + c <- true }() var buf bytes.Buffer -- 2.50.0