Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eTaskGetState for pending ready tasks #679

Merged
merged 1 commit into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
eTaskState eReturn;
List_t const * pxStateList;
List_t const * pxEventList;
List_t const * pxDelayedList;
List_t const * pxOverflowedDelayedList;
const TCB_t * const pxTCB = xTask;
Expand All @@ -1367,12 +1368,20 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
taskENTER_CRITICAL();
{
pxStateList = listLIST_ITEM_CONTAINER( &( pxTCB->xStateListItem ) );
pxEventList = listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) );
pxDelayedList = pxDelayedTaskList;
pxOverflowedDelayedList = pxOverflowDelayedTaskList;
}
taskEXIT_CRITICAL();

if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
if( pxEventList == &xPendingReadyList )
{
/* The task has been placed on the pending ready list, so its
* state is eReady regardless of what list the task's state list
* item is currently placed on. */
eReturn = eReady;
}
else if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
{
/* The task being queried is referenced from one of the Blocked
* lists. */
Expand Down