1
2
3
4
5
12 package main
13
14 import (
15 "os"
16 "runtime"
17 "runtime/pprof"
18 "sync"
19 )
20
21 func init() {
22 register("Moby25348", Moby25348)
23 }
24
25 type plugin_moby25348 struct{}
26
27 type Manager_moby25348 struct {
28 plugins []*plugin_moby25348
29 }
30
31 func (pm *Manager_moby25348) init() {
32 var group sync.WaitGroup
33 group.Add(len(pm.plugins))
34 for _, p := range pm.plugins {
35 go func(p *plugin_moby25348) {
36 defer group.Done()
37 }(p)
38 group.Wait()
39 }
40 }
41
42 func Moby25348() {
43 prof := pprof.Lookup("goroutineleak")
44 defer func() {
45
46 for i := 0; i < yieldCount; i++ {
47 runtime.Gosched()
48 }
49 prof.WriteTo(os.Stdout, 2)
50 }()
51 go func() {
52 p1 := &plugin_moby25348{}
53 p2 := &plugin_moby25348{}
54 pm := &Manager_moby25348{
55 plugins: []*plugin_moby25348{p1, p2},
56 }
57 go pm.init()
58 }()
59 }
60
View as plain text