diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-06-15 10:36:48 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-06-16 03:52:18 +0000 |
commit | ea2ac3fe5fb2011b077809e60bc018e0c6caa66c (patch) | |
tree | edcfc99c62c835097ae01a5a29521d7b9abbf9b1 | |
parent | d78d0de4d15019f87b04b49ba640a455f7c42512 (diff) | |
download | go-ea2ac3fe5fb2011b077809e60bc018e0c6caa66c.tar.gz go-ea2ac3fe5fb2011b077809e60bc018e0c6caa66c.zip |
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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
-rw-r--r-- | src/runtime/testdata/testprogcgo/aprof.go | 18 |
1 files 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 |