From: Olivier Houchard Date: Tue, 17 Jul 2018 16:29:22 +0000 (+0200) Subject: MINOR: tasklets: Don't attempt to add a tasklet in the list twice. X-Git-Tag: v1.9-dev1~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e17c2d3e57eebd8b3605fb7eb765dc05ca3bca80;p=thirdparty%2Fhaproxy.git MINOR: tasklets: Don't attempt to add a tasklet in the list twice. Don't try to add a tasklet to the run queue if it's already in there, or we might get an infinite loop. --- diff --git a/include/proto/task.h b/include/proto/task.h index d1371f3b01..8aceee508b 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -205,6 +205,8 @@ static inline struct task *task_unlink_rq(struct task *t) static inline void tasklet_wakeup(struct tasklet *tl) { + if (!LIST_ISEMPTY(&tl->list)) + return; LIST_ADDQ(&task_list[tid], &tl->list); task_list_size[tid]++; HA_ATOMIC_ADD(&tasks_run_queue, 1);