From: Willy Tarreau Date: Wed, 22 Jul 2020 12:20:14 +0000 (+0200) Subject: MINOR: tasks/debug: make the thread affinity BUG_ON check a bit stricter X-Git-Tag: v2.3-dev2~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2447bce554decc560a4e2659f164f8aafa63e3c8;p=thirdparty%2Fhaproxy.git MINOR: tasks/debug: make the thread affinity BUG_ON check a bit stricter 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. --- diff --git a/include/haproxy/task.h b/include/haproxy/task.h index 080240a752..56fd50de60 100644 --- a/include/haproxy/task.h +++ b/include/haproxy/task.h @@ -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); }