mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Added code to allow a vTaskPrioritySet() caller to pass in the current TCB as well as NULL to indicate that the priority of the calling task is being changed.
This commit is contained in:
parent
a918bd9825
commit
3f620024fc
|
@ -779,6 +779,11 @@ tskTCB * pxNewTCB;
|
||||||
|
|
||||||
taskENTER_CRITICAL();
|
taskENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
|
if( pxTask == pxCurrentTCB )
|
||||||
|
{
|
||||||
|
pxTask = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* If null is passed in here then we are changing the
|
/* If null is passed in here then we are changing the
|
||||||
priority of the calling function. */
|
priority of the calling function. */
|
||||||
pxTCB = prvGetTCBFromHandle( pxTask );
|
pxTCB = prvGetTCBFromHandle( pxTask );
|
||||||
|
@ -949,7 +954,7 @@ tskTCB * pxNewTCB;
|
||||||
|
|
||||||
/* The parameter cannot be NULL as it is impossible to resume the
|
/* The parameter cannot be NULL as it is impossible to resume the
|
||||||
currently executing task. */
|
currently executing task. */
|
||||||
if( pxTCB != NULL )
|
if( ( pxTCB != NULL ) && ( pxTCB != pxCurrentTCB ) )
|
||||||
{
|
{
|
||||||
taskENTER_CRITICAL();
|
taskENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue