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.