]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: applet: add appctx_schedule() macro
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 28 Apr 2025 16:03:36 +0000 (18:03 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 29 Apr 2025 19:19:37 +0000 (21:19 +0200)
Just like task_schedule() but for applets to wakeup an applet at a
specific time, leverages _task_schedule() internally

include/haproxy/applet.h

index 700a66795f8ce972a69e8f6d9046df7efc337daa..dbf0b15a0fb8c73ec9de80131994cfac1644119c 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)
 {