mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-25 23:12:54 +00:00
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;
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user