mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-16 18:11:03 +00:00
optimization
This commit is contained in:
parent
d9363d36ec
commit
92a7dec196
@ -55,7 +55,7 @@ func (w *Worker) run() {
|
|||||||
|
|
||||||
// stop this worker.
|
// stop this worker.
|
||||||
func (w *Worker) stop() {
|
func (w *Worker) stop() {
|
||||||
w.task <- nil
|
w.sendTask(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendTask sends a task to this worker.
|
// sendTask sends a task to this worker.
|
||||||
|
|||||||
@ -55,7 +55,7 @@ func (w *WorkerWithFunc) run() {
|
|||||||
|
|
||||||
// stop this worker.
|
// stop this worker.
|
||||||
func (w *WorkerWithFunc) stop() {
|
func (w *WorkerWithFunc) stop() {
|
||||||
w.args <- nil
|
w.sendTask(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendTask sends a task to this worker.
|
// sendTask sends a task to this worker.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user