From: Aurelien DARRAGON Date: Wed, 1 Mar 2023 11:01:04 +0000 (+0100) Subject: MINOR: event_hdl: add event_hdl_async_equeue_isempty() function X-Git-Tag: v2.8-dev7~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e98a27d6a1c393c3b71c9cce8c6e54f4b09605e;p=thirdparty%2Fhaproxy.git MINOR: event_hdl: add event_hdl_async_equeue_isempty() function Add event_hdl_async_equeue_isempty() to check is the event queue is empty from an advanced async task handler. If 68e692da0 ("MINOR: event_hdl: add event handler base api") is being backported, then this commit should be backported with it. --- diff --git a/include/haproxy/event_hdl.h b/include/haproxy/event_hdl.h index 2770d1d74f..6b396ada2d 100644 --- a/include/haproxy/event_hdl.h +++ b/include/haproxy/event_hdl.h @@ -425,6 +425,12 @@ static inline struct event_hdl_async_event *event_hdl_async_equeue_pop(event_hdl return MT_LIST_POP(queue, struct event_hdl_async_event *, mt_list); } +/* use this for advanced async mode to check if the event queue is empty */ +static inline int event_hdl_async_equeue_isempty(event_hdl_async_equeue *queue) +{ + return MT_LIST_ISEMPTY(queue); +} + /* use this to initialize event subscription list */ void event_hdl_sub_list_init(event_hdl_sub_list *sub_list);