sched.h: Simplify HAVE_GROUP_MEMBERS logic

After the retirement of CONFIG_SCHED_EXIT_KILL_CHILDREN, [1]
the behavior is now effectively controlled by
CONFIG_SCHED_CHILD_STATUS, which is IMO confusing.
(It was even surprising me.)

This commit solves it by making HAVE_GROUP_MEMBERS
a synonym of !CONFIG_DISABLE_PTHREAD. I guess this change aligns
the intention of the CONFIG_SCHED_EXIT_KILL_CHILDREN retirement.
That is, always tries to be similar to the standard behavior.

Another option would be to revive CONFIG_SCHED_EXIT_KILL_CHILDREN
and make the HAVE_GROUP_MEMBERS logic aware of it.
It might be a good idea if we want a finer-grained control of
code to build. (One can argue his application uses pthread
but does never _exit. In that case, it might be a waste to maintain
group membership. I suspect it might not be too rare in embedded
world.)

[1] commit 6982eb35fe
This commit is contained in:
YAMAMOTO Takashi 2022-10-18 14:27:28 +09:00 committed by Xiang Xiao
parent f100a4bb92
commit 8a972817e0
1 changed files with 6 additions and 13 deletions

View File

@ -51,24 +51,17 @@
/* Configuration ************************************************************/
/* Task groups currently only supported for retention of child status */
#undef HAVE_GROUP_MEMBERS
/* We need a group an group members if we are supporting the parent/child
* relationship.
/* We need to track group members at least for:
*
* - To signal all tasks in a group. (eg. SIGCHLD)
* - _exit() to collect siblings threads.
*/
#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS)
#undef HAVE_GROUP_MEMBERS
#if !defined(CONFIG_DISABLE_PTHREAD)
# define HAVE_GROUP_MEMBERS 1
#endif
/* We don't need group members if support for pthreads is disabled */
#ifdef CONFIG_DISABLE_PTHREAD
# undef HAVE_GROUP_MEMBERS
#endif
/* Sporadic scheduling */
#ifndef CONFIG_SCHED_SPORADIC_MAXREPL