From: Willy Tarreau Date: Fri, 31 Jan 2020 15:37:34 +0000 (+0100) Subject: MINOR: task: detect self-wakeups on tl==sched->current instead of TASK_RUNNING X-Git-Tag: v2.2-dev2~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b30a153cd1238b156d558adf42468af362c10b73;p=thirdparty%2Fhaproxy.git MINOR: task: detect self-wakeups on tl==sched->current instead of TASK_RUNNING This is exactly what we want to detect (a task/tasklet waking itself), so let's use the proper condition for this. --- diff --git a/include/proto/task.h b/include/proto/task.h index 53119b9d0d..68a0a18d1b 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -248,7 +248,7 @@ static inline void tasklet_wakeup(struct tasklet *tl) 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); }