Fix a bug from the previous commit

Updates #141
This commit is contained in:
Andy Pan 2021-03-19 01:21:14 +08:00
parent 36c4272286
commit e01348e424
2 changed files with 2 additions and 2 deletions

View File

@ -244,8 +244,8 @@ func (p *Pool) retrieveWorker() (w *goWorker) {
p.cond.Wait()
p.blockingNum--
if p.Running() == 0 {
p.lock.Unlock()
if !p.IsClosed() {
p.lock.Unlock()
spawnWorker()
}
return

View File

@ -262,8 +262,8 @@ func (p *PoolWithFunc) retrieveWorker() (w *goWorkerWithFunc) {
p.cond.Wait()
p.blockingNum--
if p.Running() == 0 {
p.lock.Unlock()
if !p.IsClosed() {
p.lock.Unlock()
spawnWorker()
}
return