]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: tasks: Decrement tasks_run_queue in tasklet_free().
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 24 Dec 2018 13:03:10 +0000 (14:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Dec 2018 13:04:55 +0000 (14:04 +0100)
If the tasklet is in the list, don't forget to decrement tasks_run_queue
in tasklet_free().

This should be backported to 1.9.

include/proto/task.h

index a1aa0ffb804341683e074f5383854c1714151469..bd2fe4cbb6a24a9a77d8055cc6bf02237da51103 100644 (file)
@@ -365,8 +365,10 @@ static inline void task_free(struct task *t)
 
 static inline void tasklet_free(struct tasklet *tl)
 {
-       if (!LIST_ISEMPTY(&tl->list))
+       if (!LIST_ISEMPTY(&tl->list)) {
                task_per_thread[tid].task_list_size--;
+               HA_ATOMIC_SUB(&tasks_run_queue, 1);
+       }
        LIST_DEL(&tl->list);
 
        pool_free(pool_head_tasklet, tl);