🐉 Optimize code comments

This commit is contained in:
Andy Pan 2019-01-25 22:01:11 +08:00
parent 24c28c985c
commit 65b3ac9ff7
1 changed files with 4 additions and 4 deletions

View File

@ -119,7 +119,7 @@ func NewTimingPool(size, expiry int) (*Pool, error) {
return p, nil return p, nil
} }
//------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Submit submits a task to this pool. // Submit submits a task to this pool.
func (p *Pool) Submit(task f) error { func (p *Pool) Submit(task f) error {
@ -173,7 +173,7 @@ func (p *Pool) Release() error {
return nil return nil
} }
//------------------------------------------------------------------------- //---------------------------------------------------------------------------
// incRunning increases the number of the currently running goroutines. // incRunning increases the number of the currently running goroutines.
func (p *Pool) incRunning() { func (p *Pool) incRunning() {
@ -230,7 +230,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)
// Notify there is an available worker put back into queue. // Notify the invoker stuck in 'getWorker()' of there is an available worker in the worker queue.
p.cond.Signal() p.cond.Signal()
p.lock.Unlock() p.lock.Unlock()
} }