diff --git a/README_ZH.md b/README_ZH.md index afa1290..a50e954 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -176,7 +176,7 @@ Memory : 8 GB 1867 MHz DDR3 **从该demo测试吞吐性能对比可以看出,使用ants的吞吐性能相较于原生goroutine可以保持在2-6倍的性能压制,而内存消耗则可以达到10-20倍的节省优势。** -[1]: https://travis-ci.com/panjf2000/ants.svg?branch=master +[1]: https://travis-ci.com/panjf2000/ants.svg?branch=develop [2]: https://travis-ci.com/panjf2000/ants [3]: https://godoc.org/github.com/panjf2000/ants?status.svg [4]: https://godoc.org/github.com/panjf2000/ants diff --git a/examples/main.go b/examples/main.go index 413cb36..bbf7457 100644 --- a/examples/main.go +++ b/examples/main.go @@ -47,6 +47,8 @@ func demoFunc() error { } func main() { + defer ants.Release() + runTimes := 1000 // use the common pool @@ -70,6 +72,7 @@ func main() { wg.Done() return nil }) + defer p.Release() // submit tasks for i := 0; i < runTimes; i++ { wg.Add(1)