]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: tasks: Use the MT macros in tasklet_free().
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 10 Jan 2020 15:46:48 +0000 (16:46 +0100)
committerOlivier Houchard <cognet@ci0.org>
Fri, 10 Jan 2020 15:56:59 +0000 (16:56 +0100)
In tasklet_free(), to attempt to remove ourself, use MT_LIST_DEL, we can't
just use LIST_DEL(), as we theorically could be in the shared tasklet list.

This should be backported to 2.1.

include/proto/task.h

index f3cc3eb8cc7ea77540b3e71df8f552e72e28fd60..3f1d2ad66db77b958189fc8de52b38a9ee655c58 100644 (file)
@@ -397,10 +397,8 @@ static inline void task_destroy(struct task *t)
 /* Should only be called by the thread responsible for the tasklet */
 static inline void tasklet_free(struct tasklet *tl)
 {
-       if (!LIST_ISEMPTY(&tl->list)) {
-               LIST_DEL(&tl->list);
+       if (MT_LIST_DEL((struct mt_list *)&tl->list))
                _HA_ATOMIC_SUB(&tasks_run_queue, 1);
-       }
 
        pool_free(pool_head_tasklet, tl);
        if (unlikely(stopping))