Fix free secure context for Cortex-M23 ports

Update the branching condition to correctly free secure context when
there is one.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Gaurav Aggarwal 2021-08-18 17:46:27 -07:00
parent faa92f7df2
commit 8341ffdc61
5 changed files with 12 additions and 5 deletions

View file

@ -1216,7 +1216,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
--uxCurrentNumberOfTasks;
traceTASK_DELETE( pxTCB );
prvDeleteTCB( pxTCB );
/* Reset the next expected unblock time in case it referred to
* the task that has just been deleted. */
@ -1225,6 +1224,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
}
taskEXIT_CRITICAL();
/* If the task is not deleting itself, call prvDeleteTCB from outside of
* critical section. If a task deletes itself, prvDeleteTCB is called
* from prvCheckTasksWaitingTermination which is called from Idle task. */
if( pxTCB != pxCurrentTCB )
{
prvDeleteTCB( pxTCB );
}
/* Force a reschedule if it is the currently running task that has just
* been deleted. */
if( xSchedulerRunning != pdFALSE )