From 7bf85c2a66714ce5d5d7562f6bff6972b6942c91 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 19 May 2018 12:36:28 +0800 Subject: [PATCH] optimize worker queue --- worker.go | 1 + 1 file changed, 1 insertion(+) diff --git a/worker.go b/worker.go index d380ade..332a2d6 100644 --- a/worker.go +++ b/worker.go @@ -14,6 +14,7 @@ func (w *Worker) run() { select { case f := <-w.task: f() + w.pool.workers <- w case <-w.exit: atomic.AddInt32(&w.pool.length, -1) return