This is exactly what we want to detect (a task/tasklet waking itself),
so let's use the proper condition for this.
if (tl->state & TASK_SELF_WAKING) {
LIST_ADDQ(&task_per_thread[tid].tasklets[TL_BULK], &tl->list);
}
- else if (tl->state & TASK_RUNNING) {
+ else if ((struct task *)tl == sched->current) {
_HA_ATOMIC_OR(&tl->state, TASK_SELF_WAKING);
LIST_ADDQ(&task_per_thread[tid].tasklets[TL_BULK], &tl->list);
}