From 91377c898b3e62430d286411525986952a3cc692 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 27 Jan 2019 05:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=85=20Fix=20a=20bug=20when=20using=20s?= =?UTF-8?q?ync.Pool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pool.go | 2 +- pool_func.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pool.go b/pool.go index cff7488..3eca571 100644 --- a/pool.go +++ b/pool.go @@ -207,8 +207,8 @@ func (p *Pool) retrieveWorker() *Worker { pool: p, task: make(chan f, workerChanCap), } - w.run() } + w.run() } else { for { p.cond.Wait() diff --git a/pool_func.go b/pool_func.go index d0a5cd3..2f29255 100644 --- a/pool_func.go +++ b/pool_func.go @@ -211,8 +211,8 @@ func (p *PoolWithFunc) retrieveWorker() *WorkerWithFunc { pool: p, args: make(chan interface{}, workerChanCap), } - w.run() } + w.run() } else { for { p.cond.Wait()