diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-02 22:53:02 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-02 22:53:02 -0400 |
| commit | ae9203a19764fd434ded1e4b16ce897566aba63c (patch) | |
| tree | 66802ec3ecfd985bcee370b33a42a529b6b692fb /include | |
| parent | d8be518053ec5b66250836f6989d1dffca5b021c (diff) | |
LITMUS: add framework for carrying out jobs after dropping rq locks
Many things can't be done from within the scheduler.
This framework should make it easer to defer them.
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus/norqlock.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/litmus/norqlock.h b/include/litmus/norqlock.h new file mode 100644 index 0000000000..e4c1d06f51 --- /dev/null +++ b/include/litmus/norqlock.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #ifndef NORQLOCK_H | ||
| 2 | #define NORQLOCK_H | ||
| 3 | |||
| 4 | typedef void (*work_t)(unsigned long arg); | ||
| 5 | |||
| 6 | struct no_rqlock_work { | ||
| 7 | int active; | ||
| 8 | work_t work; | ||
| 9 | unsigned long arg; | ||
| 10 | struct no_rqlock_work* next; | ||
| 11 | }; | ||
| 12 | |||
| 13 | void init_no_rqlock_work(struct no_rqlock_work* w, work_t work, | ||
| 14 | unsigned long arg); | ||
| 15 | |||
| 16 | void __do_without_rqlock(struct no_rqlock_work *work); | ||
| 17 | |||
| 18 | static inline void do_without_rqlock(struct no_rqlock_work *work) | ||
| 19 | { | ||
| 20 | if (!test_and_set_bit(0, (void*)&work->active)) | ||
| 21 | __do_without_rqlock(work); | ||
| 22 | } | ||
| 23 | |||
| 24 | void tick_no_rqlock(void); | ||
| 25 | |||
| 26 | #endif | ||
