summaryrefslogtreecommitdiff
path: root/nuttx/sched/task_restart.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-08 23:33:41 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-08 23:33:41 +0000
commit51835242fc57907004ec44d499b5278ac6cc822b (patch)
tree13c1a8443302b1e6527a50c27f5e1ba8ae1049ca /nuttx/sched/task_restart.c
parent173b6c45055ea605169f1b54458cbfbe40db467d (diff)
downloadpx4-nuttx-51835242fc57907004ec44d499b5278ac6cc822b.tar.gz
px4-nuttx-51835242fc57907004ec44d499b5278ac6cc822b.tar.bz2
px4-nuttx-51835242fc57907004ec44d499b5278ac6cc822b.zip
Add support for priority inheritance
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1581 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/task_restart.c')
-rw-r--r--nuttx/sched/task_restart.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/nuttx/sched/task_restart.c b/nuttx/sched/task_restart.c
index 3d682eb3d..c254dd303 100644
--- a/nuttx/sched/task_restart.c
+++ b/nuttx/sched/task_restart.c
@@ -1,7 +1,7 @@
-/************************************************************
- * task_restart.c
+/****************************************************************************
+ * sched/task_restart.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009 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>
#include <sys/types.h>
@@ -44,35 +44,35 @@
#include "os_internal.h"
#include "sig_internal.h"
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Name: task_restart
*
* Description:
@@ -94,7 +94,7 @@
* (2) The pid is not associated with any task known to
* the system.
*
- ************************************************************/
+ ****************************************************************************/
STATUS task_restart(pid_t pid)
{
@@ -149,6 +149,9 @@ STATUS task_restart(pid_t pid)
/* Reset the task priority */
tcb->sched_priority = tcb->init_priority;
+#ifdef CONFIG_PRIORITY_INHERITANCE
+ tcb->base_priority = tcb->init_priority;
+#endif
/* Re-initialize the processor-specific portion of the TCB
* This will reset the entry point and the start-up parameters