Add logic to retain child task exit status if so configured

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5553 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-23 22:23:46 +00:00
parent f86f863834
commit 340a72b7cd
23 changed files with 846 additions and 223 deletions
+5 -11
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* sched/task_create.c
*
* Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -81,7 +81,7 @@
*
* Input Parameters:
* name - Name of the new task
* type - Type of the new task
* ttype - Type of the new task
* priority - Priority of the new task
* stack_size - size (in bytes) of the stack needed
* entry - Entry point of a new task
@@ -99,10 +99,10 @@
****************************************************************************/
#ifndef CONFIG_CUSTOM_STACK
static int thread_create(const char *name, uint8_t type, int priority,
static int thread_create(const char *name, uint8_t ttype, int priority,
int stack_size, main_t entry, const char **argv)
#else
static int thread_create(const char *name, uint8_t type, int priority,
static int thread_create(const char *name, uint8_t ttype, int priority,
main_t entry, const char **argv)
#endif
{
@@ -142,15 +142,9 @@ static int thread_create(const char *name, uint8_t type, int priority,
}
#endif
/* Mark the type of this thread (this setting will be needed in
* task_schedsetup() when up_initial_state() is called.
*/
tcb->flags |= type;
/* Initialize the task control block */
ret = task_schedsetup(tcb, priority, task_start, entry);
ret = task_schedsetup(tcb, priority, task_start, entry, ttype);
if (ret != OK)
{
goto errout_with_tcb;