MINOR: applet: add appctx_schedule() macro
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 28 Apr 2025 16:03:36 +0000 (18:03 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 May 2025 16:07:27 +0000 (18:07 +0200)
Just like task_schedule() but for applets to wakeup an applet at a
specific time, leverages _task_schedule() internally

(cherry picked from commit 1ced5ef2fdf9a4b4ab0941849be0f4627066331f)
[wt: needed for next dns backport]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 3fdb657f6b2b02ac6b1b95be0217b06769fc499e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

include/haproxy/applet.h

index 1c9721d..20f6585 100644 (file)
@@ -146,6 +146,9 @@ static inline void __appctx_free(struct appctx *appctx)
 #define appctx_wakeup(ctx) \
        _task_wakeup((ctx)->t, TASK_WOKEN_OTHER, MK_CALLER(WAKEUP_TYPE_APPCTX_WAKEUP, 0, 0))
 
+#define appctx_schedule(ctx, w) \
+        _task_schedule((ctx)->t, w, MK_CALLER(WAKEUP_TYPE_TASK_SCHEDULE, 0, 0))
+
 /* returns the stream connector the appctx is attached to, via the sedesc */
 static inline struct stconn *appctx_sc(const struct appctx *appctx)
 {