October 2017
Intermediate to advanced
586 pages
14h 8m
English
void tasklet_init(struct tasklet_struct *t,
void (*func)(unsigned long), unsigned long data);
DECLARE_TASKLET( tasklet_example, tasklet_function, tasklet_data ); DECLARE_TASKLET_DISABLED(name, func, data);
There is one difference between the two functions: the former creates a tasklet already enabled and ready to be scheduled without any other function call, done by setting the count field to 0, whereas the latter creates a tasklet disabled (done by setting count to 1), on which you have to call tasklet_enable() before the tasklet can be schedulable:
#define DECLARE_TASKLET(name, func, data) \ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } #define DECLARE_TASKLET_DISABLED(name, ...