Skip to content

Commit ea2ac3f

Browse files
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Mikio Hara <[email protected]>
1 parent d78d0de commit ea2ac3f

File tree

1 file changed

+8
-10
lines changed
  • src/runtime/testdata/testprogcgo

1 file changed

+8
-10
lines changed

src/runtime/testdata/testprogcgo/aprof.go

+8-10
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@ func GoNop() {}
3030
func CgoCCodeSIGPROF() {
3131
c := make(chan bool)
3232
go func() {
33-
for {
34-
<-c
35-
start := time.Now()
36-
for i := 0; i < 1e7; i++ {
37-
if i%1000 == 0 {
38-
if time.Since(start) > time.Second {
39-
break
40-
}
33+
<-c
34+
start := time.Now()
35+
for i := 0; i < 1e7; i++ {
36+
if i%1000 == 0 {
37+
if time.Since(start) > time.Second {
38+
break
4139
}
42-
C.GoNop()
4340
}
44-
c <- true
41+
C.GoNop()
4542
}
43+
c <- true
4644
}()
4745

4846
var buf bytes.Buffer

0 commit comments

Comments
 (0)