]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tasklets: Don't attempt to add a tasklet in the list twice.
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 17 Jul 2018 16:29:22 +0000 (18:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:43 +0000 (16:23 +0200)
Don't try to add a tasklet to the run queue if it's already in there, or we
might get an infinite loop.

include/proto/task.h

index d1371f3b01eeb0fdc6318856b47886c558ee0a09..8aceee508bbf07ccc45d5066c06e23924e5f45ee 100644 (file)
@@ -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);