mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-19 11:17:43 -04:00
Introduce vTaskInternalSetTimeOutState() which does not have a critical section, and add a critical section to the public version of the same.
This commit is contained in:
parent
9b213e8c34
commit
c3acc441ac
6 changed files with 33 additions and 10 deletions
|
@ -3123,6 +3123,18 @@ TCB_t *pxUnblockedTCB;
|
|||
void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )
|
||||
{
|
||||
configASSERT( pxTimeOut );
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
pxTimeOut->xOverflowCount = xNumOfOverflows;
|
||||
pxTimeOut->xTimeOnEntering = xTickCount;
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut )
|
||||
{
|
||||
/* For internal use only as it does not use a critical section. */
|
||||
pxTimeOut->xOverflowCount = xNumOfOverflows;
|
||||
pxTimeOut->xTimeOnEntering = xTickCount;
|
||||
}
|
||||
|
@ -3176,7 +3188,7 @@ BaseType_t xReturn;
|
|||
{
|
||||
/* Not a genuine timeout. Adjust parameters for time remaining. */
|
||||
*pxTicksToWait -= xElapsedTime;
|
||||
vTaskSetTimeOutState( pxTimeOut );
|
||||
vTaskInternalSetTimeOutState( pxTimeOut );
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue