summaryrefslogtreecommitdiff
path: root/nuttx/sched/group_leave.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-26 20:17:29 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-26 20:17:29 +0000
commit8300858eb811cc92011e98a5d89390df420e665e (patch)
tree34b5782ba8b0613427d231151c3111b886474da1 /nuttx/sched/group_leave.c
parent03a486c40db2af681a40776e54d7f936c7e9d499 (diff)
downloadpx4-nuttx-8300858eb811cc92011e98a5d89390df420e665e.tar.gz
px4-nuttx-8300858eb811cc92011e98a5d89390df420e665e.tar.bz2
px4-nuttx-8300858eb811cc92011e98a5d89390df420e665e.zip
Move file data from TCB to task group
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5567 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/group_leave.c')
-rw-r--r--nuttx/sched/group_leave.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nuttx/sched/group_leave.c b/nuttx/sched/group_leave.c
index add424185..f5dca1829 100644
--- a/nuttx/sched/group_leave.c
+++ b/nuttx/sched/group_leave.c
@@ -177,6 +177,13 @@ void group_leave(FAR _TCB *tcb)
#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS)
group_removechildren(tcb->group);
#endif
+ /* Free all file-related resources now. We really need to close
+ * files as soon as possible while we still have a functioning task.
+ */
+
+#if CONFIG_NFILE_DESCRIPTORS > 0
+ (void)sched_releasefiles(tcb);
+#endif
/* Release all shared environment variables */
#ifndef CONFIG_DISABLE_ENVIRON
@@ -231,7 +238,14 @@ void group_leave(FAR _TCB *tcb)
#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS)
group_removechildren(tcb->group);
#endif
- /* Release all shared environment variables */
+ /* Free all file-related resources now. We really need to close
+ * files as soon as possible while we still have a functioning task.
+ */
+
+#if CONFIG_NFILE_DESCRIPTORS > 0
+ (void)sched_releasefiles(tcb);
+#endif
+ /* Release all shared environment variables */
#ifndef CONFIG_DISABLE_ENVIRON
env_release(tcb);