MEDIUM: tasklets: Make the tasklet list a struct mt_list.
Change the tasklet code so that the tasklet list is now a mt_list.
That means that tasklet now do have an associated tid, for the thread it
is expected to run on, and any thread can now call tasklet_wakeup() for
that tasklet.
One can change the associated tid with tasklet_set_tid().
diff --git a/src/checks.c b/src/checks.c
index b879100..6bde412 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1638,6 +1638,8 @@
conn = cs->conn;
/* Maybe there were an older connection we were waiting on */
check->wait_list.events = 0;
+ tasklet_set_tid(check->wait_list.tasklet, tid);
+
if (!sockaddr_alloc(&conn->dst))
return SF_ERR_RESOURCE;
@@ -2891,6 +2893,8 @@
cs_destroy(check->cs);
}
+ tasklet_set_tid(check->wait_list.tasklet, tid);
+
check->cs = cs;
conn = cs->conn;
/* Maybe there were an older connection we were waiting on */