Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT


a bug in list.h

Posted by russot hw on October 28, 2004
in line #157:
"if( ( pxList )->pxIndex == ( pxList )->pxHead )"
should be:
"if( ( pxList )->pxIndex->next == ( pxList )->pxHead )"

this means that current iteration is tail_node;

RE: a bug in list.h

Posted by Richard on October 28, 2004
I cannot see anything wrong as below:

// Increment to the next item in the list
( pxList )->pxIndex = ( pxList )->pxIndex->pxNext;

// We don't want to point to the head marker as
// it is just a marker and not a genuine list item.
// If we have incremented to the head then ...
if( ( pxList )->pxIndex == ( pxList )->pxHead )
// ... increment again. This will take us to the
// first item in the list.
( pxList )->pxIndex = ( pxList )->pxIndex->pxNext;

// Return the owner of the index - which will
// now not be the list head marker.
pxTCB = ( volatile tskTCB * ) ( pxList )->pxIndex->pvOwner;

This line is fundamental to the scheduler and if wrong nothing would work - although I am open to counter arguments....

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS