mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
freertos: Preempt other CPU when deleting a task running on it
Includes related fix to preemption unit tests (delete a queue after deleting the task blocked on it.)
This commit is contained in:
parent
ca4f5b9ee6
commit
895e7423a3
@ -1251,6 +1251,11 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB, TaskFunction_t pxTaskCode
|
|||||||
portPRE_TASK_DELETE_HOOK( pxTCB, &xYieldPending[xPortGetCoreID()] );
|
portPRE_TASK_DELETE_HOOK( pxTCB, &xYieldPending[xPortGetCoreID()] );
|
||||||
portYIELD_WITHIN_API();
|
portYIELD_WITHIN_API();
|
||||||
}
|
}
|
||||||
|
else if ( portNUM_PROCESSORS > 1 && pxTCB == pxCurrentTCB[ !xPortGetCoreID() ] )
|
||||||
|
{
|
||||||
|
/* if task is running on the other CPU, force a yield on that CPU to take it off */
|
||||||
|
vPortYieldOtherCore( !xPortGetCoreID() );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Reset the next expected unblock time in case it referred to
|
/* Reset the next expected unblock time in case it referred to
|
||||||
|
@ -66,8 +66,8 @@ TEST_CASE("Yield from lower priority task, same CPU", "[freertos]")
|
|||||||
printf("Yielding from lower priority task took %u cycles\n", delta);
|
printf("Yielding from lower priority task took %u cycles\n", delta);
|
||||||
TEST_ASSERT(delta < 10000);
|
TEST_ASSERT(delta < 10000);
|
||||||
|
|
||||||
vQueueDelete(queue);
|
|
||||||
vTaskDelete(sender_task);
|
vTaskDelete(sender_task);
|
||||||
|
vQueueDelete(queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user