mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-16 18:11:03 +00:00
🦅 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…
x
Reference in New Issue
Block a user