diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-25 23:21:27 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-25 23:21:27 +0000 |
commit | 239e2808cca6ee4c356d087bc83889fc57e64307 (patch) | |
tree | fd3a16f87e715df6729c7966a230f93214e98e20 /nuttx/sched/group_leave.c | |
parent | fdaa22ed2d565e49983e956bc056f1e0797bd9a9 (diff) | |
download | px4-firmware-239e2808cca6ee4c356d087bc83889fc57e64307.tar.gz px4-firmware-239e2808cca6ee4c356d087bc83889fc57e64307.tar.bz2 px4-firmware-239e2808cca6ee4c356d087bc83889fc57e64307.zip |
Move environment variables in the task group structure
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5565 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/group_leave.c')
-rw-r--r-- | nuttx/sched/group_leave.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/nuttx/sched/group_leave.c b/nuttx/sched/group_leave.c index 223af1556..d5fa9dbaf 100644 --- a/nuttx/sched/group_leave.c +++ b/nuttx/sched/group_leave.c @@ -44,7 +44,8 @@ #include <errno.h> #include <debug.h> -#include "os_internal.h" +#include "group_internal.h" +#include "env_internal.h" #ifdef HAVE_TASK_GROUP @@ -92,7 +93,6 @@ void group_leave(FAR _TCB *tcb) { FAR struct task_group_s *group; - int i; DEBUGASSERT(tcb); @@ -102,6 +102,8 @@ void group_leave(FAR _TCB *tcb) if (group) { #ifdef HAVE_GROUP_MEMBERS + int i; + /* Find the member in the array of members and remove it */ for (i = 0; i < group->tg_nmembers; i++) @@ -142,8 +144,14 @@ void group_leave(FAR _TCB *tcb) /* Release all of the resource contained within the group */ /* Free all un-reaped child exit status */ - task_removechildren(tcb); +#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) + task_removechildren(tcb); +#endif + /* Release all shared environment variables */ +#ifndef CONFIG_DISABLE_ENVIRON + env_release(tcb); +#endif /* Release the group container itself */ sched_free(group); @@ -166,8 +174,14 @@ void group_leave(FAR _TCB *tcb) /* Release all of the resource contained within the group */ /* Free all un-reaped child exit status */ +#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) task_removechildren(tcb); +#endif + /* Release all shared environment variables */ +#ifndef CONFIG_DISABLE_ENVIRON + env_release(tcb); +#endif /* Release the group container itself */ sched_free(group); |