Quality RTOS & Embedded Software

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




Loading

setting own prioirity using task handle

Posted by Glen B. on June 2, 2007
Richard

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;
}

Glen

RE: setting own prioirity using task handle

Posted by Glen B. on June 20, 2007
Richard

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.

RE: setting own prioirity using task handle

Posted by Richard 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.

Regards.

RE: setting own prioirity using task handle

Posted by Glen B. 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 ]    [ 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