]> git.kaiwu.me - haproxy.git/commit
MINOR: tasklet: set TASK_WOKEN_OTHER on tasklets by default
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Nov 2024 18:42:22 +0000 (19:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Dec 2024 18:45:08 +0000 (19:45 +0100)
commite6f4f15929064457c16f31634509bb18f10c3470
tree654dc160962c558fee3537cc32b20e3974065f92
parent6322c9fbbfa5f51a8e3c1dd5be7bfde2953c86fd
MINOR: tasklet: set TASK_WOKEN_OTHER on tasklets by default

Now when tasklets are woken up via tasklet_wakeup(), tasklet_wakeup_on()
or tasklet_wakeup_after(), either the optional wakeup flags will be used,
or TASK_WOKEN_OTHER will be used.

This allows tasklet handlers waking up for any given cause to notice
whether or not they were also woken for another reason. For example, a
mux handler could skip heavy parts when seeing that TASK_WOKEN_OTHER is
absent, proving that no standard tasklet_wakeup() was done, for example
in response to a subscribe().

The benefit of the TASK_WOKEN_* flags is that they're purged during the
wakeup, and that they're easy to check for using TASK_WOKEN_ANY.
TASK_F_UEVT1 and TASK_F_UEVT2 are also usable for private use (e.g. wakeup
from a stream to a connection inside a mux).

Probably that in the future, code dealing with subscribe events should
start to place TASK_WOKEN_IO like is done for upper layers.
include/haproxy/task.h