static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB, TaskFunction_t pxTaskCode, const BaseType_t xCoreID )
{
- TCB_t *curTCB;
+ TCB_t *curTCB;
BaseType_t i;
/* Ensure interrupts don't access the task lists while the lists are being
if( xSchedulerRunning != pdFALSE )
{
+ taskENTER_CRITICAL(&xTaskQueueMutex);
/* Scheduler is running. If the created task is of a higher priority than an executing task
then it should run now.
ToDo: This only works for the current core. If a task is scheduled on an other processor,
{
taskYIELD_IF_USING_PREEMPTION();
}
- else if( xCoreID != xPortGetCoreID() ) {//TODO
+ else if( xCoreID != xPortGetCoreID() ) {
taskYIELD_OTHER_CORE(xCoreID, pxNewTCB->uxPriority);
}
else
{
mtCOVERAGE_TEST_MARKER();
}
+ taskEXIT_CRITICAL(&xTaskQueueMutex);
}
else
{
http://goo.gl/wu4acr */
unsigned state;
- state = portDisableINT();
+ state = portENTER_CRITICAL_NESTED();
++uxSchedulerSuspended[ xPortGetCoreID() ];
- portEnableINT(state);
+ portEXIT_CRITICAL_NESTED(state);
}
/*----------------------------------------------------------*/
TaskHandle_t xReturn;
unsigned state;
- state = portDisableINT();
+ state = portENTER_CRITICAL_NESTED();
xReturn = pxCurrentTCB[ xPortGetCoreID() ];
- portEnableINT(state);
+ portEXIT_CRITICAL_NESTED(state);
return xReturn;
}
BaseType_t xReturn;
unsigned state;
- state = portDisableINT();
+ state = portENTER_CRITICAL_NESTED();
if( xSchedulerRunning == pdFALSE )
{
xReturn = taskSCHEDULER_NOT_STARTED;
xReturn = taskSCHEDULER_SUSPENDED;
}
}
- portEnableINT(state);
+ portEXIT_CRITICAL_NESTED(state);
return xReturn;
}
TCB_t *curTCB;
/* If xSemaphoreCreateMutex() is called before any tasks have been created
- then xTaskGetCurrentTaskHandle() will be NULL. */
+ then pxCurrentTCB will be NULL. */
taskENTER_CRITICAL(&xTaskQueueMutex);
if( pxCurrentTCB[ xPortGetCoreID() ] != NULL )
{