1
2
3
4
5
12
13 package main
14
15 import (
16 "context"
17 "os"
18 "runtime"
19 "runtime/pprof"
20 )
21
22 func init() {
23 register("Cockroach13755", Cockroach13755)
24 }
25
26 type Rows_cockroach13755 struct {
27 cancel context.CancelFunc
28 }
29
30 func (rs *Rows_cockroach13755) initContextClose(ctx context.Context) {
31 ctx, rs.cancel = context.WithCancel(ctx)
32 go rs.awaitDone(ctx)
33 }
34
35 func (rs *Rows_cockroach13755) awaitDone(ctx context.Context) {
36 <-ctx.Done()
37 rs.close(ctx.Err())
38 }
39
40 func (rs *Rows_cockroach13755) close(err error) {
41 rs.cancel()
42 }
43
44
45
46
47
48
49
50
51
52
53
54 func Cockroach13755() {
55 prof := pprof.Lookup("goroutineleak")
56 defer func() {
57
58 for i := 0; i < yieldCount; i++ {
59 runtime.Gosched()
60 }
61 prof.WriteTo(os.Stdout, 2)
62 }()
63
64 rs := &Rows_cockroach13755{}
65 rs.initContextClose(context.Background())
66 }
67
View as plain text