Blame view

include/linux/task_work.h 578 Bytes
e73f8959a   Oleg Nesterov   task_work_add: ge...
1
2
3
4
5
  #ifndef _LINUX_TASK_WORK_H
  #define _LINUX_TASK_WORK_H
  
  #include <linux/list.h>
  #include <linux/sched.h>
67d121455   Al Viro   merge task_work a...
6
  typedef void (*task_work_func_t)(struct callback_head *);
e73f8959a   Oleg Nesterov   task_work_add: ge...
7
8
  
  static inline void
67d121455   Al Viro   merge task_work a...
9
  init_task_work(struct callback_head *twork, task_work_func_t func)
e73f8959a   Oleg Nesterov   task_work_add: ge...
10
11
  {
  	twork->func = func;
e73f8959a   Oleg Nesterov   task_work_add: ge...
12
  }
67d121455   Al Viro   merge task_work a...
13
14
  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);
e73f8959a   Oleg Nesterov   task_work_add: ge...
15
16
17
18
  void task_work_run(void);
  
  static inline void exit_task_work(struct task_struct *task)
  {
9da33de62   Oleg Nesterov   task_work: task_w...
19
  	task_work_run();
e73f8959a   Oleg Nesterov   task_work_add: ge...
20
21
22
  }
  
  #endif	/* _LINUX_TASK_WORK_H */