Quality RTOS & Embedded Software

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


setting own prioirity using task handle

Posted by *anonymous on June 2, 2007


Quite some time ago I think you added the following code to vTaskDelete() at my request. This was to allow a task to properly delete itself by passing its own task handle rather than NULL. I think a similar addition should be added in to vTaskPrioritySet().

/* Ensure a yield is performed if the current task is being deleted. */ if( pxTaskToDelete == pxCurrentTCB ) { __pxTaskToDelete = NULL; }


setting own prioirity using task handle

Posted by *anonymous on June 20, 2007


I have seen no response to this.

If that means you intend to do it great.

If it means that you do not, then I think you should re-consider. Currently, if a thread lowers its own priority using its own task handle rather than NULL, and the new priority is lower than the priority of the next higher priority ready task, then it will continue running until the next context switch even though it is not the highest priority task. This would have to be considered a bug in the kernel.

setting own prioirity using task handle

Posted by richardbarry on June 20, 2007

Hi Glen, I didn't realise you were waiting for a reply.  Thanks for drawing my attention to this.  It is actually something that was highlighted during the SafeRTOS analysis, and to be honest I cannot remember why I did not migrate the change into the FreeRTOS.org code too.  I cannot think of why the change shouldn't be implemented.


setting own prioirity using task handle

Posted by *anonymous on June 21, 2007

No problem. I just wanted to be sure I didn't leave this hanging without being properly understood.

I was curious about whether it had slipped by into SafeRTOS. It is encouraging to hear that the analysis was thorough enough to catch something like this.

Cheers Glen

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

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

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner