add one more check when getting worker

This commit is contained in:
andy pan 2018-05-22 16:10:29 +08:00
parent 967b0b04e2
commit f4a3fc5efd
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ func (p *Pool) getWorker() *Worker {
p.lock.Unlock() p.lock.Unlock()
break break
} }
} else { } else if w == nil {
wp := p.workerPool.Get() wp := p.workerPool.Get()
if wp == nil { if wp == nil {
w = &Worker{ w = &Worker{