Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24560
b: refs/heads/master
c: 29ff471
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Mar 29, 2006
1 parent dfa9166 commit 6975a43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 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: 6b3934ef52712ece50605dfc72e55d00c580831a
refs/heads/master: 29ff471234d53c7235db287bc52f91884c2977c6
31 changes: 15 additions & 16 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,24 +341,20 @@ void __exit_sighand(struct task_struct *tsk)
*/
void __exit_signal(struct task_struct *tsk)
{
struct signal_struct * sig = tsk->signal;
struct sighand_struct * sighand;
struct signal_struct *sig = tsk->signal;
struct sighand_struct *sighand;

BUG_ON(!sig);
BUG_ON(!atomic_read(&sig->count));

if (!sig)
BUG();
if (!atomic_read(&sig->count))
BUG();
rcu_read_lock();
sighand = rcu_dereference(tsk->sighand);
spin_lock(&sighand->siglock);

posix_cpu_timers_exit(tsk);
if (atomic_dec_and_test(&sig->count)) {
if (atomic_dec_and_test(&sig->count))
posix_cpu_timers_exit_group(tsk);
tsk->signal = NULL;
__exit_sighand(tsk);
spin_unlock(&sighand->siglock);
flush_sigqueue(&sig->shared_pending);
} else {
else {
/*
* If there is any task waiting for the group exit
* then notify it:
Expand All @@ -369,7 +365,6 @@ void __exit_signal(struct task_struct *tsk)
}
if (tsk == sig->curr_target)
sig->curr_target = next_thread(tsk);
tsk->signal = NULL;
/*
* Accumulate here the counters for all threads but the
* group leader as they die, so they can be added into
Expand All @@ -387,14 +382,18 @@ void __exit_signal(struct task_struct *tsk)
sig->nvcsw += tsk->nvcsw;
sig->nivcsw += tsk->nivcsw;
sig->sched_time += tsk->sched_time;
__exit_sighand(tsk);
spin_unlock(&sighand->siglock);
sig = NULL; /* Marker for below. */
sig = NULL; /* Marker for below. */
}

tsk->signal = NULL;
__exit_sighand(tsk);
spin_unlock(&sighand->siglock);
rcu_read_unlock();

clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
flush_sigqueue(&tsk->pending);
if (sig) {
flush_sigqueue(&sig->shared_pending);
__cleanup_signal(sig);
}
}
Expand Down

0 comments on commit 6975a43

Please sign in to comment.