From 109dc9b03a66b023b14eee16e5a43eb3b0e8fb67 Mon Sep 17 00:00:00 2001 From: andy pan Date: Mon, 2 Jul 2018 14:16:39 +0800 Subject: [PATCH] update example code --- examples/main.go | 3 +++ 1 file changed, 3 insertions(+) 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)