diff --git a/worker.go b/worker.go index 4875266..eb8f9cc 100644 --- a/worker.go +++ b/worker.go @@ -54,6 +54,7 @@ func (w *Worker) run() { } } }() + for f := range w.task { if f == nil { w.pool.decRunning() @@ -63,4 +64,4 @@ func (w *Worker) run() { w.pool.putWorker(w) } }() -} +} \ No newline at end of file diff --git a/worker_func.go b/worker_func.go index 24b2bd3..47ece34 100644 --- a/worker_func.go +++ b/worker_func.go @@ -54,6 +54,7 @@ func (w *WorkerWithFunc) run() { } } }() + for args := range w.args { if args == nil { w.pool.decRunning() @@ -63,4 +64,4 @@ func (w *WorkerWithFunc) run() { w.pool.putWorker(w) } }() -} +} \ No newline at end of file