2012-05-10 18:59:07 -06:00
|
|
|
#ifndef _LINUX_TASK_WORK_H
|
|
|
|
#define _LINUX_TASK_WORK_H
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
|
2012-06-27 01:07:19 -06:00
|
|
|
typedef void (*task_work_func_t)(struct callback_head *);
|
2012-05-10 18:59:07 -06:00
|
|
|
|
|
|
|
static inline void
|
2012-06-27 01:07:19 -06:00
|
|
|
init_task_work(struct callback_head *twork, task_work_func_t func)
|
2012-05-10 18:59:07 -06:00
|
|
|
{
|
|
|
|
twork->func = func;
|
|
|
|
}
|
|
|
|
|
2012-06-27 01:07:19 -06:00
|
|
|
int task_work_add(struct task_struct *task, struct callback_head *twork, bool);
|
|
|
|
struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
|
2012-05-10 18:59:07 -06:00
|
|
|
void task_work_run(void);
|
|
|
|
|
|
|
|
static inline void exit_task_work(struct task_struct *task)
|
|
|
|
{
|
2012-08-26 13:12:11 -06:00
|
|
|
task_work_run();
|
2012-05-10 18:59:07 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _LINUX_TASK_WORK_H */
|