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.
This commit is contained in:
parent
12c24235ca
commit
b582339079
36
src/task.c
36
src/task.c
@ -476,41 +476,41 @@ void mworker_cleantasks()
|
|||||||
{
|
{
|
||||||
struct task *t;
|
struct task *t;
|
||||||
int i;
|
int i;
|
||||||
struct eb32_node *next_wq = NULL;
|
struct eb32_node *tmp_wq = NULL;
|
||||||
struct eb32sc_node *next_rq = NULL;
|
struct eb32sc_node *tmp_rq = NULL;
|
||||||
|
|
||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
/* cleanup the global run queue */
|
/* cleanup the global run queue */
|
||||||
next_rq = eb32sc_first(&rqueue, MAX_THREADS);
|
tmp_rq = eb32sc_first(&rqueue, MAX_THREADS_MASK);
|
||||||
while (next_rq) {
|
while (tmp_rq) {
|
||||||
t = eb32sc_entry(next_rq, struct task, rq);
|
t = eb32sc_entry(tmp_rq, struct task, rq);
|
||||||
next_rq = eb32sc_next(rq_next, MAX_THREADS_MASK);
|
tmp_rq = eb32sc_next(tmp_rq, MAX_THREADS_MASK);
|
||||||
task_delete(t);
|
task_delete(t);
|
||||||
task_free(t);
|
task_free(t);
|
||||||
}
|
}
|
||||||
/* cleanup the timers queue */
|
/* cleanup the timers queue */
|
||||||
next_wq = eb32_first(&timers);
|
tmp_wq = eb32_first(&timers);
|
||||||
while (next_wq) {
|
while (tmp_wq) {
|
||||||
t = eb32_entry(next_wq, struct task, wq);
|
t = eb32_entry(tmp_wq, struct task, wq);
|
||||||
next_wq = eb32_next(next_wq);
|
tmp_wq = eb32_next(tmp_wq);
|
||||||
task_delete(t);
|
task_delete(t);
|
||||||
task_free(t);
|
task_free(t);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* clean the per thread run queue */
|
/* clean the per thread run queue */
|
||||||
for (i = 0; i < global.nbthread; i++) {
|
for (i = 0; i < global.nbthread; i++) {
|
||||||
next_rq = eb32sc_first(&task_per_thread[i].rqueue, MAX_THREADS_MASK);
|
tmp_rq = eb32sc_first(&task_per_thread[i].rqueue, MAX_THREADS_MASK);
|
||||||
while (next_rq) {
|
while (tmp_rq) {
|
||||||
t = eb32sc_entry(next_rq, struct task, rq);
|
t = eb32sc_entry(tmp_rq, struct task, rq);
|
||||||
next_rq = eb32sc_next(next_rq, MAX_THREADS_MASK);
|
tmp_rq = eb32sc_next(tmp_rq, MAX_THREADS_MASK);
|
||||||
task_delete(t);
|
task_delete(t);
|
||||||
task_free(t);
|
task_free(t);
|
||||||
}
|
}
|
||||||
/* cleanup the per thread timers queue */
|
/* cleanup the per thread timers queue */
|
||||||
next_wq = eb32_first(&task_per_thread[i].timers);
|
tmp_wq = eb32_first(&task_per_thread[i].timers);
|
||||||
while (next_wq) {
|
while (tmp_wq) {
|
||||||
t = eb32_entry(next_wq, struct task, wq);
|
t = eb32_entry(tmp_wq, struct task, wq);
|
||||||
next_wq = eb32_next(next_wq);
|
tmp_wq = eb32_next(tmp_wq);
|
||||||
task_delete(t);
|
task_delete(t);
|
||||||
task_free(t);
|
task_free(t);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user