]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: tasks: Don't forget to decrement tasks_run_queue.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 3 Oct 2019 12:55:34 +0000 (14:55 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 3 Oct 2019 12:55:40 +0000 (14:55 +0200)
When executing tasks, don't forget to decrement tasks_run_queue once we
popped one task from the task_list. tasks_run_queue used to be decremented
by __tasklet_remove_from_tasklet_list(), but we now call MT_LIST_POP().

src/task.c

index 0d818711e6ba5bb04812c20a07f354398ee3defe..9ac02117b0ea7c616d5dea80acd64503b4e415d1 100644 (file)
@@ -393,6 +393,7 @@ void process_runnable_tasks()
                t = (struct task *)MT_LIST_POP(&tt->task_list, struct tasklet *, list);
                if (!t)
                        break;
+               _HA_ATOMIC_SUB(&tasks_run_queue, 1);
                state = _HA_ATOMIC_XCHG(&t->state, TASK_RUNNING);
                __ha_barrier_atomic_store();