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.
This commit is contained in:
Willy Tarreau 2020-07-22 14:20:14 +02:00
parent 783afbe93b
commit 2447bce554

View File

@ -259,7 +259,7 @@ static inline void task_queue(struct task *task)
} else } else
#endif #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)) if (!task_in_wq(task) || tick_is_lt(task->expire, task->wq.key))
__task_queue(task, &sched->timers); __task_queue(task, &sched->timers);
} }