2012-05-11 00:59:07 +00:00
|
|
|
#ifndef _LINUX_TASK_WORK_H
|
|
|
|
#define _LINUX_TASK_WORK_H
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
|
2012-06-27 07:07:19 +00:00
|
|
|
typedef void (*task_work_func_t)(struct callback_head *);
|
2012-05-11 00:59:07 +00:00
|
|
|
|
|
|
|
static inline void
|
2012-06-27 07:07:19 +00:00
|
|
|
init_task_work(struct callback_head *twork, task_work_func_t func)
|
2012-05-11 00:59:07 +00:00
|
|
|
{
|
|
|
|
twork->func = func;
|
|
|
|
}
|
|
|
|
|
2012-06-27 07:07:19 +00: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-11 00:59:07 +00:00
|
|
|
void task_work_run(void);
|
|
|
|
|
|
|
|
static inline void exit_task_work(struct task_struct *task)
|
|
|
|
{
|
2012-08-26 19:12:11 +00:00
|
|
|
task_work_run();
|
2012-05-11 00:59:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _LINUX_TASK_WORK_H */
|