This reverts commit
d9404b464faae3340ac1745b594929e4b7edd650.
In fact, there is a BUG_ON() in __task_free() function to be sure the task
is no longer in the wait-queue or the run-queue. Because the patch tries to
fix a "leak" on deinit, it is safer to revert it. there is no reason to
introduce potential bug for this kind of issues. And there is no reason to
impact the normal use-cases at runtime with additionnal conditions to only
remove a task on deinit.
}
/* Destroys a task : it's unlinked from the wait queues and is freed if it's
- * the current task or not queued or if HAProxy is stopping. Otherwise it's
- * marked to be freed by the scheduler. It does nothing if <t> is NULL.
+ * the current task or not queued otherwise it's marked to be freed by the
+ * scheduler. It does nothing if <t> is NULL.
*/
static inline void task_destroy(struct task *t)
{
/* There's no need to protect t->state with a lock, as the task
* has to run on the current thread.
*/
- if (t == th_ctx->current || !(t->state & (TASK_QUEUED | TASK_RUNNING)) || (global.mode & MODE_STOPPING))
+ if (t == th_ctx->current || !(t->state & (TASK_QUEUED | TASK_RUNNING)))
__task_free(t);
else
t->process = NULL;