task_work.h 578 B

12345678910111213141516171819202122232425
  1. #ifndef _LINUX_TASK_WORK_H
  2. #define _LINUX_TASK_WORK_H
  3. #include <linux/list.h>
  4. #include <linux/sched.h>
  5. typedef void (*task_work_func_t)(struct callback_head *);
  6. static inline void
  7. init_task_work(struct callback_head *twork, task_work_func_t func)
  8. {
  9. twork->func = func;
  10. }
  11. int task_work_add(struct task_struct *task, struct callback_head *twork, bool);
  12. struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
  13. void task_work_run(void);
  14. static inline void exit_task_work(struct task_struct *task)
  15. {
  16. task_work_run();
  17. }
  18. #endif /* _LINUX_TASK_WORK_H */