summaryrefslogtreecommitdiff
path: root/nuttx/sched/sched_removereadytorun.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/sched_removereadytorun.c')
-rw-r--r--nuttx/sched/sched_removereadytorun.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/nuttx/sched/sched_removereadytorun.c b/nuttx/sched/sched_removereadytorun.c
index 2c3c8352d..ee848e8f0 100644
--- a/nuttx/sched/sched_removereadytorun.c
+++ b/nuttx/sched/sched_removereadytorun.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sched_removereadytorun.c
+/****************************************************************************
+ * shced/sched_removereadytorun.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,42 +31,42 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <sys/types.h>
#include <queue.h>
#include <assert.h>
#include "os_internal.h"
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Name: sched_removereadytorun
*
* Description:
@@ -85,7 +85,7 @@
* a good idea -- use irqsave()).
* - The caller handles the condition that occurs if the
* the head of the g_readytorun list is changed.
- ************************************************************/
+ ****************************************************************************/
boolean sched_removereadytorun(FAR _TCB *rtcb)
{
@@ -98,6 +98,8 @@ boolean sched_removereadytorun(FAR _TCB *rtcb)
if (!rtcb->blink)
{
+ /* There must always be at least one task in the list (the idle task) */
+
ASSERT(rtcb->flink != NULL);
/* Inform the instrumentation layer that we are switching tasks */