diff options
author | Oleg Nesterov <oleg@redhat.com> | 2011-06-22 17:10:26 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2011-06-27 14:30:10 -0400 |
commit | 087806b1281563e4ae7a5bce3155f894af5f4118 (patch) | |
tree | 01547cd793de4e06f633293efa530a13ff2724a6 /fs/exec.c | |
parent | d4f7c511c1c2a67eb287987cf1ce9554149030e6 (diff) |
redefine thread_group_leader() as exit_signal >= 0
Change de_thread() to set old_leader->exit_signal = -1. This is
good for the consistency, it is no longer the leader and all
sub-threads have exit_signal = -1 set by copy_process(CLONE_THREAD).
And this allows us to micro-optimize thread_group_leader(), it can
simply check exit_signal >= 0. This also makes sense because we
should move ->group_leader from task_struct to signal_struct.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -963,6 +963,7 @@ static int de_thread(struct task_struct *tsk) | |||
963 | leader->group_leader = tsk; | 963 | leader->group_leader = tsk; |
964 | 964 | ||
965 | tsk->exit_signal = SIGCHLD; | 965 | tsk->exit_signal = SIGCHLD; |
966 | leader->exit_signal = -1; | ||
966 | 967 | ||
967 | BUG_ON(leader->exit_state != EXIT_ZOMBIE); | 968 | BUG_ON(leader->exit_state != EXIT_ZOMBIE); |
968 | leader->exit_state = EXIT_DEAD; | 969 | leader->exit_state = EXIT_DEAD; |