]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: detect self-wakeups on tl==sched->current instead of TASK_RUNNING
authorWilly Tarreau <w@1wt.eu>
Fri, 31 Jan 2020 15:37:34 +0000 (16:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 31 Jan 2020 16:45:10 +0000 (17:45 +0100)
This is exactly what we want to detect (a task/tasklet waking itself),
so let's use the proper condition for this.

include/proto/task.h

index 53119b9d0dba9e38d0208a73c4c8b9201531e75a..68a0a18d1b5a16e5b0100a235c4f8ff725d0fe61 100644 (file)
@@ -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);
                        }