mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
exit: avoid sig->count in __exit_signal() to detect the group-dead case
Change __exit_signal() to check thread_group_leader() instead of atomic_dec_and_test(&sig->count). This must be equivalent, the group leader must be released only after all other threads have exited and passed __exit_signal(). Henceforth sig->count is not actually used, except in fs/proc for get_nr_threads/etc. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@redhat.com> Cc: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d344193a05
commit
4a59994297
1 changed files with 3 additions and 2 deletions
|
@ -88,11 +88,12 @@ static void __exit_signal(struct task_struct *tsk)
|
||||||
rcu_read_lock_held() ||
|
rcu_read_lock_held() ||
|
||||||
lockdep_tasklist_lock_is_held());
|
lockdep_tasklist_lock_is_held());
|
||||||
spin_lock(&sighand->siglock);
|
spin_lock(&sighand->siglock);
|
||||||
|
atomic_dec(&sig->count);
|
||||||
|
|
||||||
posix_cpu_timers_exit(tsk);
|
posix_cpu_timers_exit(tsk);
|
||||||
if (atomic_dec_and_test(&sig->count))
|
if (thread_group_leader(tsk)) {
|
||||||
posix_cpu_timers_exit_group(tsk);
|
posix_cpu_timers_exit_group(tsk);
|
||||||
else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* If there is any task waiting for the group exit
|
* If there is any task waiting for the group exit
|
||||||
* then notify it:
|
* then notify it:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue