Skip to content

Commit

Permalink
sched: Remove SCHED_EXIT_KILL_CHILDREN option
Browse files Browse the repository at this point in the history
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 <[email protected]>
Change-Id: I2950ddee3d471272bb9570782f1cd4af33513d57
  • Loading branch information
xiaoxiang781216 authored and patacongo committed Jun 15, 2020
1 parent f70981c commit 6982eb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions sched/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sched/task/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6982eb3

Please sign in to comment.