From 6982eb35feb2daba8a55d7f89c716c28aaf126e0 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 11 Jun 2020 10:29:21 +0800 Subject: [PATCH] sched: Remove SCHED_EXIT_KILL_CHILDREN option All standard indicate exit should terminate the whole process/task: https://pubs.opengroup.org/onlinepubs/007904975/functions/exit.html https://en.cppreference.com/w/c/program/exit https://linux.die.net/man/2/exit so let's remove the option and trust the caller know the difference: 1.exit terminate all threads belong the current process/task 2.pthread_exit only terminate the current(main/pthread) thread Signed-off-by: Xiang Xiao Change-Id: I2950ddee3d471272bb9570782f1cd4af33513d57 --- sched/Kconfig | 12 ------------ sched/task/exit.c | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/sched/Kconfig b/sched/Kconfig index 931e233864..f7fe1efe81 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -616,18 +616,6 @@ config SCHED_WAITPID compliant) and will enable the waitid() and wait() interfaces as well. -config SCHED_EXIT_KILL_CHILDREN - bool "Enable kill all children when exit" - default n - depends on SCHED_HAVE_PARENT && SCHED_CHILD_STATUS - ---help--- - When a task exits, all of its child threads will be killed. - - Caution: This selection should not be used unless you are certain - of what you are doing. Uninformed of this option can often lead to - memory leaks since, for example, memory allocations held by threads - are not automatically freed! - config SCHED_USER_IDENTITY bool "Support per-task User Identity" default n diff --git a/sched/task/exit.c b/sched/task/exit.c index fed287abfa..102ddaa12d 100644 --- a/sched/task/exit.c +++ b/sched/task/exit.c @@ -78,7 +78,7 @@ void exit(int status) status &= 0xff; -#ifdef CONFIG_SCHED_EXIT_KILL_CHILDREN +#ifdef HAVE_GROUP_MEMBERS /* Kill all of the children of the group, preserving only this thread. * exit() is normally called from the main thread of the task. pthreads * exit through a different mechanism.