Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327180
b: refs/heads/master
c: f991b31
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Aug 21, 2012
1 parent f4a6e99 commit 47f1433
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 203b42f7317494ae5e5efc7be6fb7f29c927f102
refs/heads/master: f991b318cc6627a493b0d317a565bb7c3271f36b
48 changes: 23 additions & 25 deletions trunk/include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,20 @@ struct execute_work {
__WORK_INIT_LOCKDEP_MAP(#n, &(n)) \
}

#define __DELAYED_WORK_INITIALIZER(n, f) { \
#define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \
.work = __WORK_INITIALIZER((n).work, (f)), \
.timer = TIMER_INITIALIZER(delayed_work_timer_fn, \
0, (unsigned long)&(n)), \
}

#define __DEFERRABLE_WORK_INITIALIZER(n, f) { \
.work = __WORK_INITIALIZER((n).work, (f)), \
.timer = TIMER_DEFERRED_INITIALIZER(delayed_work_timer_fn, \
0, (unsigned long)&(n)), \
.timer = __TIMER_INITIALIZER(delayed_work_timer_fn, \
0, (unsigned long)&(n), (tflags)), \
}

#define DECLARE_WORK(n, f) \
struct work_struct n = __WORK_INITIALIZER(n, f)

#define DECLARE_DELAYED_WORK(n, f) \
struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f)
struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, 0)

#define DECLARE_DEFERRABLE_WORK(n, f) \
struct delayed_work n = __DEFERRABLE_WORK_INITIALIZER(n, f)
struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE)

/*
* initialize a work item's function pointer
Expand Down Expand Up @@ -216,29 +210,33 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
__INIT_WORK((_work), (_func), 1); \
} while (0)

#define INIT_DELAYED_WORK(_work, _func) \
#define __INIT_DELAYED_WORK(_work, _func, _tflags) \
do { \
INIT_WORK(&(_work)->work, (_func)); \
init_timer(&(_work)->timer); \
(_work)->timer.function = delayed_work_timer_fn; \
(_work)->timer.data = (unsigned long)(_work); \
__setup_timer(&(_work)->timer, delayed_work_timer_fn, \
(unsigned long)(_work), (_tflags)); \
} while (0)

#define INIT_DELAYED_WORK_ONSTACK(_work, _func) \
#define __INIT_DELAYED_WORK_ONSTACK(_work, _func, _tflags) \
do { \
INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
init_timer_on_stack(&(_work)->timer); \
(_work)->timer.function = delayed_work_timer_fn; \
(_work)->timer.data = (unsigned long)(_work); \
__setup_timer_on_stack(&(_work)->timer, \
delayed_work_timer_fn, \
(unsigned long)(_work), \
(_tflags)); \
} while (0)

#define INIT_DELAYED_WORK(_work, _func) \
__INIT_DELAYED_WORK(_work, _func, 0)

#define INIT_DELAYED_WORK_ONSTACK(_work, _func) \
__INIT_DELAYED_WORK_ONSTACK(_work, _func, 0)

#define INIT_DEFERRABLE_WORK(_work, _func) \
do { \
INIT_WORK(&(_work)->work, (_func)); \
init_timer_deferrable(&(_work)->timer); \
(_work)->timer.function = delayed_work_timer_fn; \
(_work)->timer.data = (unsigned long)(_work); \
} while (0)
__INIT_DELAYED_WORK(_work, _func, TIMER_DEFERRABLE)

#define INIT_DEFERRABLE_WORK_ONSTACK(_work, _func) \
__INIT_DELAYED_WORK_ONSTACK(_work, _func, TIMER_DEFERRABLE)

/**
* work_pending - Find out whether a work item is currently pending
Expand Down

0 comments on commit 47f1433

Please sign in to comment.