You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/10/19 13:32:36 UTC
[incubator-nuttx] branch master updated (f100a4bb92 -> a31316cab5)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
from f100a4bb92 Implement fdopendir
new 8a972817e0 sched.h: Simplify HAVE_GROUP_MEMBERS logic
new a31316cab5 group_kill_children_handler: use nxtask_delete as this is in-kernel
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
include/nuttx/sched.h | 19 ++++++-------------
sched/group/group_killchildren.c | 6 +++---
2 files changed, 9 insertions(+), 16 deletions(-)
[incubator-nuttx] 01/02: sched.h: Simplify HAVE_GROUP_MEMBERS logic
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 8a972817e0e4c541f720eeb994a498ae2a659352
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Oct 18 14:27:28 2022 +0900
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 6982eb35feb2daba8a55d7f89c716c28aaf126e0
---
include/nuttx/sched.h | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h
index 88680f71ae..c22785b245 100644
--- a/include/nuttx/sched.h
+++ b/include/nuttx/sched.h
@@ -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
[incubator-nuttx] 02/02: group_kill_children_handler: use nxtask_delete as this is in-kernel
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit a31316cab513db9013a41bf0e321e20858c691de
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Oct 19 19:33:30 2022 +0900
group_kill_children_handler: use nxtask_delete as this is in-kernel
---
sched/group/group_killchildren.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sched/group/group_killchildren.c b/sched/group/group_killchildren.c
index e06197eac7..4f35c6a38b 100644
--- a/sched/group/group_killchildren.c
+++ b/sched/group/group_killchildren.c
@@ -67,8 +67,8 @@ static int group_kill_children_handler(pid_t pid, FAR void *arg)
{
/* Cancel this thread. This is a forced cancellation. Make sure that
* cancellation is not disabled by the task/thread. That bit will
- * prevent pthread_cancel() or task_delete() from doing what they need
- * to do.
+ * prevent pthread_cancel() or nxtask_delete() from doing what they
+ * need to do.
*/
rtcb = nxsched_get_tcb(pid);
@@ -92,7 +92,7 @@ static int group_kill_children_handler(pid_t pid, FAR void *arg)
}
else
{
- ret = task_delete(pid);
+ ret = nxtask_delete(pid);
}
if (ret < 0)