indicate "any thread". It's ignored and replaced by zero when threads
are disabled.
-void tasklet_wakeup(tl)
+void tasklet_wakeup(tl, [flags])
Make sure that tasklet <tl> will wake up, that is, will execute at
least once. The tasklet will run on its assigned thread, or on any
- thread if its TID is negative.
+ thread if its TID is negative. An optional <flags> value may be passed
+ to set a wakeup cause on the tasklet's flags, typically TASK_WOKEN_* or
+ TASK_F_UEVT*. When not set, 0 is passed (i.e. no flags are changed).
-struct list *tasklet_wakeup_after(head, tl)
+struct list *tasklet_wakeup_after(head, tl, [flags])
Schedule tasklet <tl> to run immediately the current one if <head> is
NULL, or after the last queued one if <head> is non-null. The new head
is returned, to be passed to the next call. The purpose here is to
already queued tasklets. This may induce extra latencies for pending
jobs and must only be used extremely carefully when it's certain that
the processing will benefit from using fresh data from the L1 cache.
+ An optional <flags> value may be passed to set a wakeup cause on the
+ tasklet's flags, typically TASK_WOKEN_* or TASK_F_UEVT*. When not set,
+ 0 is passed (i.e. no flags are changed).
-void tasklet_wakeup_on(tl, thr)
+void tasklet_wakeup_on(tl, thr, [flags])
Make sure that tasklet <tl> will wake up on thread <thr>, that is, will
execute at least once. The designated thread may only differ from the
calling one if the tasklet is already configured to run on another
thread, and it is not permitted to self-assign a tasklet if its tid is
negative, as it may already be scheduled to run somewhere else. Just in
case, only use tasklet_wakeup() which will pick the tasklet's assigned
- thread ID.
+ thread ID. An optional <flags> value may be passed to set a wakeup
+ cause on the tasklet's flags, typically TASK_WOKEN_* or TASK_F_UEVT*.
+ When not set, 0 is passed (i.e. no flags are changed).
struct tasklet *tasklet_new()
Allocate a new tasklet and set it to run by default on the calling
* at least once scheduled on a specific thread. With DEBUG_TASK, the
* <file>:<line> from the call place are stored into the tasklet for tracing
* purposes.
+ *
+ * The macro accepts an optional 3rd argument that is passed as a set of flags
+ * to be set on the tasklet, among TASK_WOKEN_*, TASK_F_UEVT* etc to indicate a
+ * wakeup cause to the tasklet. When not set, the arg defaults to zero (i.e. no
+ * flag is added).
*/
-#define tasklet_wakeup_on(tl, thr) \
- _tasklet_wakeup_on(tl, thr, 0, MK_CALLER(WAKEUP_TYPE_TASKLET_WAKEUP, 0, 0))
+#define tasklet_wakeup_on(tl, thr, ...) \
+ _tasklet_wakeup_on(tl, thr, DEFZERO(__VA_ARGS__), MK_CALLER(WAKEUP_TYPE_TASKLET_WAKEUP, 0, 0))
static inline void _tasklet_wakeup_on(struct tasklet *tl, int thr, uint f, const struct ha_caller *caller)
{
* is either its owner thread if >= 0 or the current thread if < 0. When
* DEBUG_TASK is set, the <file>:<line> from the call place are stored into the
* task for tracing purposes.
+ *
+ * The macro accepts an optional 3rd argument that is passed as a set of flags
+ * to be set on the tasklet, among TASK_WOKEN_*, TASK_F_UEVT* etc to indicate a
+ * wakeup cause to the tasklet. When not set, the arg defaults to zero (i.e. no
+ * flag is added).
*/
-#define tasklet_wakeup(tl) \
- _tasklet_wakeup_on(tl, (tl)->tid, 0, MK_CALLER(WAKEUP_TYPE_TASKLET_WAKEUP, 0, 0))
+#define tasklet_wakeup(tl, ...) \
+ _tasklet_wakeup_on(tl, (tl)->tid, DEFZERO(__VA_ARGS__), MK_CALLER(WAKEUP_TYPE_TASKLET_WAKEUP, 0, 0))
/* instantly wakes up task <t> on its owner thread even if it's not the current
* one, bypassing the run queue. The purpose is to be able to avoid contention
* thread will be used.
* With DEBUG_TASK, the <file>:<line> from the call place are stored into the tasklet
* for tracing purposes.
+ *
+ * The macro accepts an optional 3rd argument that is passed as a set of flags
+ * to be set on the tasklet, among TASK_WOKEN_*, TASK_F_UEVT* etc to indicate a
+ * wakeup cause to the tasklet. When not set, the arg defaults to zero (i.e. no
+ * flag is added).
*/
-#define tasklet_wakeup_after(head, tl) \
- _tasklet_wakeup_after(head, tl, 0, MK_CALLER(WAKEUP_TYPE_TASKLET_WAKEUP_AFTER, 0, 0))
+#define tasklet_wakeup_after(head, tl, ...) \
+ _tasklet_wakeup_after(head, tl, DEFZERO(__VA_ARGS__), MK_CALLER(WAKEUP_TYPE_TASKLET_WAKEUP_AFTER, 0, 0))
static inline struct list *_tasklet_wakeup_after(struct list *head, struct tasklet *tl,
uint f, const struct ha_caller *caller)