This commit is contained in:
AndyPan 2018-09-30 09:40:33 +08:00
parent e238e0fad0
commit e8ccc8ecca
2 changed files with 4 additions and 4 deletions

View File

@ -196,10 +196,10 @@ func (p *Pool) getWorker() *Worker {
}
if waiting {
for{
for {
p.cond.Wait()
l := len(p.workers) - 1
if l < 0{
if l < 0 {
continue
}
w = p.workers[l]

View File

@ -198,10 +198,10 @@ func (p *PoolWithFunc) getWorker() *WorkerWithFunc {
}
if waiting {
for{
for {
p.cond.Wait()
l := len(p.workers) - 1
if l < 0{
if l < 0 {
continue
}
w = p.workers[l]