]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: event_hdl: normal tasks support for advanced async mode
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 28 Feb 2023 14:06:48 +0000 (15:06 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:58:17 +0000 (08:58 +0200)
commitb289fd1420010119ad47d74d7359bffffe19a56c
treed1cf2206197fc57b79421724841d6af6df5bf1fc
parentafcfc20e1436a9e97cf9429d7403554b15c21687
MINOR: event_hdl: normal tasks support for advanced async mode

advanced async mode (EVENT_HDL_ASYNC_TASK) provided full support for
custom tasklets registration.

Due to the similarities between tasks and tasklets, it may be useful
to use the advanced mode with an existing task (not a tasklet).
While the API did not explicitly disallow this usage, things would
get bad if we try to wakeup a task using tasklet_wakeup() for notifying
the task about new events.

To make the API support both custom tasks and tasklets, we use the
TASK_IS_TASKLET() macro to call the proper waking function depending
on the task's type:

  - For tasklets: we use tasklet_wakeup()
  - For tasks: we use task_wakeup()

If 68e692da0 ("MINOR: event_hdl: add event handler base api")
is being backported, then this commit should be backported with it.
doc/internals/api/event_hdl.txt
include/haproxy/event_hdl.h
src/event_hdl.c