]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: task: allow to use tasklet_wakeup_after with tid -1
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 13 Apr 2023 09:48:50 +0000 (11:48 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Apr 2023 14:20:47 +0000 (16:20 +0200)
Adjust BUG_ON() statement to allow tasklet_wakeup_after() for tasklets
with tid pinned to -1 (the current thread). This is similar to
tasklet_wakeup().

This should be backported up to 2.6.

src/task.c

index 990ab42813b8270070009bfaff7d7263d8939013..12b24b460c499968a454e5005c4e85158ac48b7f 100644 (file)
@@ -170,7 +170,7 @@ void __tasklet_wakeup_on(struct tasklet *tl, int thr)
  */
 struct list *__tasklet_wakeup_after(struct list *head, struct tasklet *tl)
 {
-       BUG_ON(tid != tl->tid);
+       BUG_ON(tl->tid >= 0 && tid != tl->tid);
        /* this tasklet runs on the caller thread */
        if (!head) {
                if (tl->state & TASK_HEAVY) {