update example code

This commit is contained in:
andy pan 2018-07-02 14:16:39 +08:00
parent fdf34beb43
commit 109dc9b03a
1 changed files with 3 additions and 0 deletions

View File

@ -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)