Don't suspend scheduler if task already notified (#1190)

* Don't suspend scheduler if task already notified
pull/1191/head^2
Jeff Tenney 3 months ago committed by GitHub
parent 9736947af2
commit 8f7f451c2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7659,6 +7659,10 @@ TickType_t uxTaskResetEventItemValue( void )
configASSERT( uxIndexToWaitOn < configTASK_NOTIFICATION_ARRAY_ENTRIES );
/* If the notification count is zero, and if we are willing to wait for a
* notification, then block the task and wait. */
if( ( pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] == 0U ) && ( xTicksToWait > ( TickType_t ) 0 ) )
{
/* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a
* non-deterministic operation. */
vTaskSuspendAll();
@ -7675,8 +7679,7 @@ TickType_t uxTaskResetEventItemValue( void )
/* Mark this task as waiting for a notification. */
pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION;
if( xTicksToWait > ( TickType_t ) 0 )
{
/* Arrange to wait for a notification. */
xShouldBlock = pdTRUE;
}
else
@ -7684,11 +7687,6 @@ TickType_t uxTaskResetEventItemValue( void )
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
taskEXIT_CRITICAL();
/* We are now out of the critical section but the scheduler is still
@ -7715,6 +7713,7 @@ TickType_t uxTaskResetEventItemValue( void )
{
mtCOVERAGE_TEST_MARKER();
}
}
taskENTER_CRITICAL();
{
@ -7763,6 +7762,10 @@ TickType_t uxTaskResetEventItemValue( void )
configASSERT( uxIndexToWaitOn < configTASK_NOTIFICATION_ARRAY_ENTRIES );
/* If the task hasn't received a notification, and if we are willing to wait
* for it, then block the task and wait. */
if( ( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED ) && ( xTicksToWait > ( TickType_t ) 0 ) )
{
/* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a
* non-deterministic operation. */
vTaskSuspendAll();
@ -7783,8 +7786,7 @@ TickType_t uxTaskResetEventItemValue( void )
/* Mark this task as waiting for a notification. */
pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION;
if( xTicksToWait > ( TickType_t ) 0 )
{
/* Arrange to wait for a notification. */
xShouldBlock = pdTRUE;
}
else
@ -7792,11 +7794,6 @@ TickType_t uxTaskResetEventItemValue( void )
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
taskEXIT_CRITICAL();
/* We are now out of the critical section but the scheduler is still
@ -7823,6 +7820,7 @@ TickType_t uxTaskResetEventItemValue( void )
{
mtCOVERAGE_TEST_MARKER();
}
}
taskENTER_CRITICAL();
{

Loading…
Cancel
Save