MINOR: tasks/debug: add a BUG_ON() check to detect requeued task on free

__task_free() cannot be called with a task still in the queue. This
test adds a check which confirms there is no concurrency issue on such
a case where a thread could requeue nor wakeup a task being freed.
This commit is contained in:
Willy Tarreau 2020-07-22 14:33:53 +02:00
parent e5d79bccc0
commit f2452b3c70

View File

@ -473,6 +473,7 @@ static inline void __task_free(struct task *t)
sched->current = NULL;
__ha_barrier_store();
}
BUG_ON(task_in_wq(t) || task_in_rq(t));
pool_free(pool_head_task, t);
if (unlikely(stopping))
pool_flush(pool_head_task);