diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-06-30 23:56:26 -0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-06-30 23:56:26 -0300 |
commit | c81310d41ab762e49315f37b0818272e8dce12a2 (patch) | |
tree | 85e0fc0f4e6067c741ede9972c584d51f93d5661 /libdde_linux26/lib/src | |
parent | 4ee6908ccdbfbc860ef69dae37debd51cdf0d446 (diff) |
Add tasklet_kill
* libdde_linux26/lib/src/arch/l4/softirq.c (tasklet_kill): New function.
Diffstat (limited to 'libdde_linux26/lib/src')
-rw-r--r-- | libdde_linux26/lib/src/arch/l4/softirq.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libdde_linux26/lib/src/arch/l4/softirq.c b/libdde_linux26/lib/src/arch/l4/softirq.c index 247a414f..d93bfaff 100644 --- a/libdde_linux26/lib/src/arch/l4/softirq.c +++ b/libdde_linux26/lib/src/arch/l4/softirq.c @@ -67,6 +67,20 @@ void tasklet_init(struct tasklet_struct *t, t->data = data; } +void tasklet_kill(struct tasklet_struct *t) +{ + if (in_interrupt()) + printk("Attempt to kill tasklet from interrupt\n"); + + while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { + do + yield(); + while (test_bit(TASKLET_STATE_SCHED, &t->state)); + } + tasklet_unlock_wait(t); + clear_bit(TASKLET_STATE_SCHED, &t->state); +} + /* enqueue tasklet */ static void __tasklet_enqueue(struct tasklet_struct *t, struct tasklet_head *listhead) |