/* ucTasksDeleted is used to prevent vTaskSuspendAll() being called
too often in the idle task. */
+ taskENTER_CRITICAL(&xTaskQueueMutex);
while( uxTasksDeleted > ( UBaseType_t ) 0U )
{
- taskENTER_CRITICAL(&xTaskQueueMutex);
+ //taskENTER_CRITICAL(&xTaskQueueMutex);
{
xListIsEmpty = listLIST_IS_EMPTY( &xTasksWaitingTermination );
}
- taskEXIT_CRITICAL(&xTaskQueueMutex);
+ //taskEXIT_CRITICAL(&xTaskQueueMutex);
if( xListIsEmpty == pdFALSE )
{
TCB_t *pxTCB;
- taskENTER_CRITICAL(&xTaskQueueMutex);
+ //taskENTER_CRITICAL(&xTaskQueueMutex);
{
pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );
( void ) uxListRemove( &( pxTCB->xGenericListItem ) );
--uxCurrentNumberOfTasks;
--uxTasksDeleted;
}
- taskEXIT_CRITICAL(&xTaskQueueMutex);
+ //taskEXIT_CRITICAL(&xTaskQueueMutex);
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
{
{
mtCOVERAGE_TEST_MARKER();
}
- }
+ }
+ taskEXIT_CRITICAL(&xTaskQueueMutex);
}
#endif /* vTaskDelete */
}
{
TaskHandle_t xReturn;
+ vPortCPUAcquireMutex(&xTaskQueueMutex);
/* A critical section is not required as this is not called from
an interrupt and the current TCB will always be the same for any
individual execution thread. */
xReturn = pxCurrentTCB[ xPortGetCoreID() ];
+ vPortCPUReleaseMutex(&xTaskQueueMutex);
return xReturn;
}