chore: update some comments

Fixes #346
This commit is contained in:
Andy Pan 2024-12-11 21:09:56 +08:00
parent e7e3c844aa
commit 99121e2404
2 changed files with 2 additions and 8 deletions

View File

@ -110,10 +110,7 @@ func (p *Pool) purgeStaleWorkers() {
isDormant = n == 0 || n == len(staleWorkers)
p.lock.Unlock()
// Notify obsolete workers to stop.
// This notification must be outside the p.lock, since w.task
// may be blocking and may consume a lot of time if many workers
// are located on non-local CPUs.
// Clean up the stale workers.
for i := range staleWorkers {
staleWorkers[i].finish()
staleWorkers[i] = nil

View File

@ -67,10 +67,7 @@ func (p *PoolWithFunc) purgeStaleWorkers() {
isDormant = n == 0 || n == len(staleWorkers)
p.lock.Unlock()
// Notify obsolete workers to stop.
// This notification must be outside the p.lock, since w.task
// may be blocking and may consume a lot of time if many workers
// are located on non-local CPUs.
// Clean up the stale workers.
for i := range staleWorkers {
staleWorkers[i].finish()
staleWorkers[i] = nil