forked from mirror/ants
🦅 Fix a bug when using sync.Pool
This commit is contained in:
parent
822158c59c
commit
91377c898b
2
pool.go
2
pool.go
|
@ -207,8 +207,8 @@ func (p *Pool) retrieveWorker() *Worker {
|
|||
pool: p,
|
||||
task: make(chan f, workerChanCap),
|
||||
}
|
||||
w.run()
|
||||
}
|
||||
w.run()
|
||||
} else {
|
||||
for {
|
||||
p.cond.Wait()
|
||||
|
|
|
@ -211,8 +211,8 @@ func (p *PoolWithFunc) retrieveWorker() *WorkerWithFunc {
|
|||
pool: p,
|
||||
args: make(chan interface{}, workerChanCap),
|
||||
}
|
||||
w.run()
|
||||
}
|
||||
w.run()
|
||||
} else {
|
||||
for {
|
||||
p.cond.Wait()
|
||||
|
|
Loading…
Reference in New Issue