mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-19 11:17:43 -04:00
Change behaviour when configUSE_PREEMPTION is 0 (preemption is turned off). See the change history in the next release for details.
Remove an erroneous const in the prototype of queue receive/peek functions.
This commit is contained in:
parent
30bc6c01a9
commit
20eb03ed7d
3 changed files with 58 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
All rights reserved
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
@ -104,6 +104,14 @@ privileged Vs unprivileged linkage and placement. */
|
|||
*/
|
||||
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
|
||||
#if( configUSE_PREEMPTION == 0 )
|
||||
/* If the cooperative scheduler is being used then a yield should not be
|
||||
performed just because a higher priority task has been woken. */
|
||||
#define taskYIELD_IF_USING_PREEMPTION()
|
||||
#else
|
||||
#define taskYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Task control block. A task control block (TCB) is allocated for each task,
|
||||
* and stores task state information, including a pointer to the task's context
|
||||
|
@ -621,7 +629,7 @@ tskTCB * pxNewTCB;
|
|||
then it should run now. */
|
||||
if( pxCurrentTCB->uxPriority < uxPriority )
|
||||
{
|
||||
portYIELD_WITHIN_API();
|
||||
taskYIELD_IF_USING_PREEMPTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -844,7 +852,7 @@ tskTCB * pxNewTCB;
|
|||
else if( pxStateList == &xSuspendedTaskList )
|
||||
{
|
||||
/* The task being queried is referenced from the suspended
|
||||
list. Is it genuinely suspended or is it block
|
||||
list. Is it genuinely suspended or is it block
|
||||
indefinitely? */
|
||||
if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL )
|
||||
{
|
||||
|
@ -1019,7 +1027,7 @@ tskTCB * pxNewTCB;
|
|||
|
||||
if( xYieldRequired == pdTRUE )
|
||||
{
|
||||
portYIELD_WITHIN_API();
|
||||
taskYIELD_IF_USING_PREEMPTION();
|
||||
}
|
||||
|
||||
/* Remove compiler warning about unused variables when the port
|
||||
|
@ -1155,9 +1163,10 @@ tskTCB * pxNewTCB;
|
|||
/* We may have just resumed a higher priority task. */
|
||||
if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
|
||||
{
|
||||
/* This yield may not cause the task just resumed to run, but
|
||||
will leave the lists in the correct state for the next yield. */
|
||||
portYIELD_WITHIN_API();
|
||||
/* This yield may not cause the task just resumed to run,
|
||||
but will leave the lists in the correct state for the
|
||||
next yield. */
|
||||
taskYIELD_IF_USING_PREEMPTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1407,8 +1416,12 @@ portBASE_TYPE xAlreadyYielded = pdFALSE;
|
|||
|
||||
if( xYieldPending == pdTRUE )
|
||||
{
|
||||
xAlreadyYielded = pdTRUE;
|
||||
portYIELD_WITHIN_API();
|
||||
#if( configUSE_PREEMPTION != 0 )
|
||||
{
|
||||
xAlreadyYielded = pdTRUE;
|
||||
}
|
||||
#endif
|
||||
taskYIELD_IF_USING_PREEMPTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1694,7 +1707,7 @@ portBASE_TYPE xSwitchRequired = pdFALSE;
|
|||
}
|
||||
}
|
||||
#endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) ) */
|
||||
|
||||
|
||||
#if ( configUSE_TICK_HOOK == 1 )
|
||||
{
|
||||
/* Guard against the tick hook being called when the pended tick
|
||||
|
@ -1704,7 +1717,7 @@ portBASE_TYPE xSwitchRequired = pdFALSE;
|
|||
vApplicationTickHook();
|
||||
}
|
||||
}
|
||||
#endif /* configUSE_TICK_HOOK */
|
||||
#endif /* configUSE_TICK_HOOK */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue