Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312948
b: refs/heads/master
c: a2d4c71
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 22, 2012
1 parent 2f3bb0d commit 341a26f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 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: ed3e694d78cc75fa79bf29698631b146fd27aa35
refs/heads/master: a2d4c71d1559426155e5da8db3265bfa0d8d398d
26 changes: 14 additions & 12 deletions trunk/kernel/task_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@ void task_work_run(void)
struct task_struct *task = current;
struct callback_head *p, *q;

raw_spin_lock_irq(&task->pi_lock);
p = task->task_works;
task->task_works = NULL;
raw_spin_unlock_irq(&task->pi_lock);
while (1) {
raw_spin_lock_irq(&task->pi_lock);
p = task->task_works;
task->task_works = NULL;
raw_spin_unlock_irq(&task->pi_lock);

if (unlikely(!p))
return;
if (unlikely(!p))
return;

q = p->next; /* head */
p->next = NULL; /* cut it */
while (q) {
p = q->next;
q->func(q);
q = p;
q = p->next; /* head */
p->next = NULL; /* cut it */
while (q) {
p = q->next;
q->func(q);
q = p;
}
}
}

0 comments on commit 341a26f

Please sign in to comment.