mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-18 11:21:02 +00:00
supplement annotations
This commit is contained in:
parent
917dfb037f
commit
4320708756
2
pool.go
2
pool.go
@ -226,7 +226,7 @@ func (p *Pool) putWorker(worker *Worker) {
|
|||||||
worker.recycleTime = time.Now()
|
worker.recycleTime = time.Now()
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
p.workers = append(p.workers, worker)
|
p.workers = append(p.workers, worker)
|
||||||
// notify there is available worker
|
// Notify there is an available worker put back into queue.
|
||||||
p.cond.Signal()
|
p.cond.Signal()
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,7 @@ func (p *PoolWithFunc) putWorker(worker *WorkerWithFunc) {
|
|||||||
worker.recycleTime = time.Now()
|
worker.recycleTime = time.Now()
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
p.workers = append(p.workers, worker)
|
p.workers = append(p.workers, worker)
|
||||||
// notify there is available worker
|
// Notify there is an available worker put back into queue.
|
||||||
p.cond.Signal()
|
p.cond.Signal()
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user