diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-30 18:49:31 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-30 18:49:31 +0000 |
commit | 013eef130f1bc2cab1e3f4022d8498fb98bb29bf (patch) | |
tree | a6455ca9fb6a1aaab3f305b1bf5e937bff704f59 /nuttx/sched/task_delete.c | |
parent | 802ee953dd39863a9b296d8ffbfcc428f2d6fc4f (diff) | |
download | px4-nuttx-013eef130f1bc2cab1e3f4022d8498fb98bb29bf.tar.gz px4-nuttx-013eef130f1bc2cab1e3f4022d8498fb98bb29bf.tar.bz2 px4-nuttx-013eef130f1bc2cab1e3f4022d8498fb98bb29bf.zip |
errno was clobbered by mm_trysemaphore when task exists
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@591 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/task_delete.c')
-rw-r--r-- | nuttx/sched/task_delete.c | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task_delete.c index 691b7c57e..369f601ed 100644 --- a/nuttx/sched/task_delete.c +++ b/nuttx/sched/task_delete.c @@ -1,7 +1,7 @@ -/************************************************************ - * task_delete.c +/**************************************************************************** + * sched/task_delete.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include <nuttx/config.h> @@ -46,41 +46,40 @@ # include "sig_internal.h" #endif -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Type Declarations - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Global Variables - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Variables - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Name: task_delete * * Description: - * This function causes a specified task to cease to exist. - * Its stack and TCB will be deallocated. This function - * is the companion to task_create(). + * This function causes a specified task to cease to exist. Its stack and + * TCB will be deallocated. This function is the companion to task_create(). * * Inputs: * pid - The task ID of the task to delete. A pid of zero @@ -89,10 +88,10 @@ * Return Value: * OK on success; or ERROR on failure * - * This function can fail if the provided pid does not - * correspond to a task (errno is not set) + * This function can fail if the provided pid does not correspond to a + * task (errno is not set) * - ************************************************************/ + ****************************************************************************/ STATUS task_delete(pid_t pid) { @@ -106,17 +105,15 @@ STATUS task_delete(pid_t pid) rtcb = (FAR _TCB*)g_readytorun.head; if (pid == 0 || pid == rtcb->pid) { - /* If it is, then what we really wanted to do was exit. - * Note that we don't bother to unlock the TCB since - * it will be going away. + /* If it is, then what we really wanted to do was exit. Note that we + * don't bother to unlock the TCB since it will be going away. */ exit(EXIT_SUCCESS); } - /* Make sure the task does not become ready-to-run while - * we are futzing with its TCB by locking ourselves as the - * executing task. + /* Make sure the task does not become ready-to-run while we are futzing with + * its TCB by locking ourselves as the executing task. */ sched_lock(); |