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