]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tasks/debug: make the thread affinity BUG_ON check a bit stricter
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Jul 2020 12:20:14 +0000 (14:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Jul 2020 12:22:38 +0000 (14:22 +0200)
The BUG_ON() test in task_queue() only tests for the case where
we're queuing a task that doesn't run on the current thread. Let's
refine it a bit further to catch all cases where the task does not
run *exactly* on the current thread alone.

include/haproxy/task.h

index 080240a752de93aa8cdd449d1d9a167e36ded1f5..56fd50de60ffc663b0df4f7b5ba153cc250db623 100644 (file)
@@ -259,7 +259,7 @@ static inline void task_queue(struct task *task)
        } else
 #endif
        {
-               BUG_ON((task->thread_mask & tid_bit) == 0); // should have TASK_SHARED_WQ
+               BUG_ON(task->thread_mask != tid_bit); // should have TASK_SHARED_WQ
                if (!task_in_wq(task) || tick_is_lt(task->expire, task->wq.key))
                        __task_queue(task, &sched->timers);
        }