20#define INIT_WORK(_work, _func) do { \
21 (_work)->func = (_func); \
22 (_work)->pending = 0; \
23 (_work)->data = NULL; \
27#define schedule_work(work) \
28 do { if ((work)->func) (work)->func(work); } while (0)
30#define queue_work(wq, work) \
31 do { if ((work)->func) (work)->func(work); } while (0)
33#define flush_work(work) do {} while (0)
34#define cancel_work_sync(work) do {} while (0)
35#define flush_workqueue(wq) do {} while (0)
36#define destroy_workqueue(wq) do {} while (0)
39alloc_ordered_workqueue(
const char*
name,
int flags) {
45#define create_singlethread_workqueue(name) \
46 alloc_ordered_workqueue(name, 0)
49#define container_of_work(ptr, type, member) \
50 container_of(ptr, type, member)
58#define INIT_DELAYED_WORK(_dwork, _func) do { \
59 INIT_WORK(&(_dwork)->work, _func); \
60 timer_setup(&(_dwork)->timer, NULL, 0); \
61 (_dwork)->wq = NULL; \
65static inline bool schedule_delayed_work(
struct delayed_work* dwork,
66 unsigned long delay) {
74 unsigned long delay) {
80static inline bool cancel_delayed_work(
struct delayed_work* dwork) {
81 del_timer(&dwork->
timer);
86static inline bool cancel_delayed_work_sync(
struct delayed_work* dwork) {
87 return cancel_delayed_work(dwork);
90static inline bool flush_delayed_work(
struct delayed_work* dwork) {
95#define to_delayed_work(ptr) \
96 container_of(ptr, struct delayed_work, work)
Definition workqueue.h:52
struct timer_list timer
Definition workqueue.h:54
struct work_struct work
Definition workqueue.h:53
struct workqueue_struct * wq
Definition workqueue.h:55
int pending
Definition workqueue.h:11
void * data
Definition workqueue.h:10
work_func_t func
Definition workqueue.h:9
Definition workqueue.h:14
const char * name
Definition workqueue.h:15
void(* work_func_t)(struct work_struct *work)
Definition workqueue.h:6