diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2020-07-14 12:18:01 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-14 12:18:01 -0700 |
| commit | ec2ffdf65f8b2b64f3f40062f0a24861b72cf39f (patch) | |
| tree | abf9938a2452964a9f2d39b2501f78fe90f7dbe2 /kernel/exit.c | |
| parent | 11bb2f7a45909f4f64afe471875672ae1b84a380 (diff) | |
| parent | f06b71fe4d4cd0a4ad7e183b777564f696f6bb36 (diff) | |
| download | linux-ec2ffdf65f8b2b64f3f40062f0a24861b72cf39f.tar.bz2 | |
Merge branch 'usermode-driver-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace into bpf-next
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 727150f28103..39226a018ed7 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -804,7 +804,6 @@ void __noreturn do_exit(long code) exit_task_namespaces(tsk); exit_task_work(tsk); exit_thread(tsk); - exit_umh(tsk); /* * Flush inherited counters to the parent - before the parent @@ -1711,6 +1710,30 @@ Efault: } #endif +/** + * thread_group_exited - check that a thread group has exited + * @pid: tgid of thread group to be checked. + * + * Test if the thread group represented by tgid has exited (all + * threads are zombies, dead or completely gone). + * + * Return: true if the thread group has exited. false otherwise. + */ +bool thread_group_exited(struct pid *pid) +{ + struct task_struct *task; + bool exited; + + rcu_read_lock(); + task = pid_task(pid, PIDTYPE_PID); + exited = !task || + (READ_ONCE(task->exit_state) && thread_group_empty(task)); + rcu_read_unlock(); + + return exited; +} +EXPORT_SYMBOL(thread_group_exited); + __weak void abort(void) { BUG(); |