Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255024
b: refs/heads/master
c: a841796
h: refs/heads/master
v: v3
  • Loading branch information
Paul E. McKenney authored and Paul E. McKenney committed Jul 20, 2011
1 parent 7996c75 commit cb5cf56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 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: ec433f0c51527426989ea8a38a856d810d739414
refs/heads/master: a841796f11c90d53dbac773be56b04fbee8af272
19 changes: 13 additions & 6 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,18 +1178,25 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
{
struct sighand_struct *sighand;

rcu_read_lock();
for (;;) {
local_irq_save(*flags);
rcu_read_lock();
sighand = rcu_dereference(tsk->sighand);
if (unlikely(sighand == NULL))
if (unlikely(sighand == NULL)) {
rcu_read_unlock();
local_irq_restore(*flags);
break;
}

spin_lock_irqsave(&sighand->siglock, *flags);
if (likely(sighand == tsk->sighand))
spin_lock(&sighand->siglock);
if (likely(sighand == tsk->sighand)) {
rcu_read_unlock();
break;
spin_unlock_irqrestore(&sighand->siglock, *flags);
}
spin_unlock(&sighand->siglock);
rcu_read_unlock();
local_irq_restore(*flags);
}
rcu_read_unlock();

return sighand;
}
Expand Down

0 comments on commit cb5cf56

Please sign in to comment.