forked from mirror/ants
add some annotations
This commit is contained in:
parent
846a758f65
commit
d052cf95e1
2
pool.go
2
pool.go
|
@ -224,7 +224,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)
|
||||||
//通知有一个空闲的worker
|
// notify there is available worker
|
||||||
p.cond.Signal()
|
p.cond.Signal()
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,7 +227,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)
|
||||||
//通知有一个空闲的worker
|
// notify there is available worker
|
||||||
p.cond.Signal()
|
p.cond.Signal()
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue