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