mirror of https://github.com/panjf2000/ants.git
update example code
This commit is contained in:
parent
fdf34beb43
commit
109dc9b03a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue