]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: fix several typos in mworker_cleantasks()
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Dec 2018 14:14:37 +0000 (15:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Dec 2018 14:38:24 +0000 (15:38 +0100)
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

index b9b8bd2b30c05eb60a58b140375b540de4d16c02..11a171d45ca2c790408620bf2f1a7c45c6e20299 100644 (file)
@@ -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);
                }