From b582339079ed9a8c5ff104a6ad155193f727707a Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Thu, 6 Dec 2018 15:14:37 +0100 Subject: [PATCH] BUG/MEDIUM: mworker: fix several typos in mworker_cleantasks() Commit 27f3fa5 ("BUG/MEDIUM: mworker: stop every tasks in the master") used MAX_THREADS as a mask instead of MAX_THREADS_MASK to clean the global run queue, and used rq_next (global variable) instead of next_rq. Renamed next_rq as tmp_rq and next_wq as tmp_wq to avoid confusion. No backport needed. --- src/task.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/task.c b/src/task.c index b9b8bd2b3..11a171d45 100644 --- a/src/task.c +++ b/src/task.c @@ -476,41 +476,41 @@ void mworker_cleantasks() { struct task *t; int i; - struct eb32_node *next_wq = NULL; - struct eb32sc_node *next_rq = NULL; + struct eb32_node *tmp_wq = NULL; + struct eb32sc_node *tmp_rq = NULL; #ifdef USE_THREAD /* cleanup the global run queue */ - next_rq = eb32sc_first(&rqueue, MAX_THREADS); - while (next_rq) { - t = eb32sc_entry(next_rq, struct task, rq); - next_rq = eb32sc_next(rq_next, MAX_THREADS_MASK); + tmp_rq = eb32sc_first(&rqueue, MAX_THREADS_MASK); + while (tmp_rq) { + t = eb32sc_entry(tmp_rq, struct task, rq); + tmp_rq = eb32sc_next(tmp_rq, MAX_THREADS_MASK); task_delete(t); task_free(t); } /* cleanup the timers queue */ - next_wq = eb32_first(&timers); - while (next_wq) { - t = eb32_entry(next_wq, struct task, wq); - next_wq = eb32_next(next_wq); + tmp_wq = eb32_first(&timers); + while (tmp_wq) { + t = eb32_entry(tmp_wq, struct task, wq); + tmp_wq = eb32_next(tmp_wq); task_delete(t); task_free(t); } #endif /* clean the per thread run queue */ for (i = 0; i < global.nbthread; i++) { - next_rq = eb32sc_first(&task_per_thread[i].rqueue, MAX_THREADS_MASK); - while (next_rq) { - t = eb32sc_entry(next_rq, struct task, rq); - next_rq = eb32sc_next(next_rq, MAX_THREADS_MASK); + tmp_rq = eb32sc_first(&task_per_thread[i].rqueue, MAX_THREADS_MASK); + while (tmp_rq) { + t = eb32sc_entry(tmp_rq, struct task, rq); + tmp_rq = eb32sc_next(tmp_rq, MAX_THREADS_MASK); task_delete(t); task_free(t); } /* cleanup the per thread timers queue */ - next_wq = eb32_first(&task_per_thread[i].timers); - while (next_wq) { - t = eb32_entry(next_wq, struct task, wq); - next_wq = eb32_next(next_wq); + tmp_wq = eb32_first(&task_per_thread[i].timers); + while (tmp_wq) { + t = eb32_entry(tmp_wq, struct task, wq); + tmp_wq = eb32_next(tmp_wq); task_delete(t); task_free(t); }