From 92a7dec1965da64fe7f53dc6afc5e2a3ede40cae Mon Sep 17 00:00:00 2001 From: andy pan Date: Wed, 30 May 2018 12:37:13 +0800 Subject: [PATCH] optimization --- worker.go | 2 +- worker_func.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worker.go b/worker.go index 5b8426b..c4df148 100644 --- a/worker.go +++ b/worker.go @@ -55,7 +55,7 @@ func (w *Worker) run() { // stop this worker. func (w *Worker) stop() { - w.task <- nil + w.sendTask(nil) } // sendTask sends a task to this worker. diff --git a/worker_func.go b/worker_func.go index b8d59ec..b149411 100644 --- a/worker_func.go +++ b/worker_func.go @@ -55,7 +55,7 @@ func (w *WorkerWithFunc) run() { // stop this worker. func (w *WorkerWithFunc) stop() { - w.args <- nil + w.sendTask(nil) } // sendTask sends a task to this worker.