MINOR: tasks: Allow tasklet_wakeup() to wakeup a task.
Modify tasklet_wakeup() so that it handles a task as well, and inserts it
directly into the tasklet list, making it effectively a tasklet.
This should make future developments easier.
diff --git a/include/proto/task.h b/include/proto/task.h
index cb3f9af..13398c5 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -106,6 +106,9 @@
__decl_hathreads(extern HA_SPINLOCK_T rq_lock); /* spin lock related to run queue */
__decl_hathreads(extern HA_SPINLOCK_T wq_lock); /* spin lock related to wait queue */
+
+static inline void task_insert_into_tasklet_list(struct task *t);
+
/* return 0 if task is in run queue, otherwise non-zero */
static inline int task_in_rq(struct task *t)
{
@@ -215,6 +218,10 @@
static inline void tasklet_wakeup(struct tasklet *tl)
{
+ if (!TASK_IS_TASKLET(tl)) {
+ task_insert_into_tasklet_list((struct task *)tl);
+ return;
+ }
if (!LIST_ISEMPTY(&tl->list))
return;
LIST_ADDQ(&task_list[tid], &tl->list);