Skip to content

Commit

Permalink
FreeRTOS: add mutex hold count to task status info
Browse files Browse the repository at this point in the history
  • Loading branch information
dexterbg committed Aug 2, 2020
1 parent cf056a7 commit b501d31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/freertos/include/freertos/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ typedef struct xTASK_STATUS
eTaskState eCurrentState; /*!< The state in which the task existed when the structure was populated. */
UBaseType_t uxCurrentPriority; /*!< The priority at which the task was running (may be inherited) when the structure was populated. */
UBaseType_t uxBasePriority; /*!< The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
UBaseType_t uxMutexesHeld; /*!< The number of mutexes currently held by the task. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
uint32_t ulRunTimeCounter; /*!< The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
StackType_t *pxStackBase; /*!< Points to the lowest address of the task's stack area. */
uint32_t usStackHighWaterMark; /*!< The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
Expand Down
2 changes: 2 additions & 0 deletions components/freertos/tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -3753,10 +3753,12 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
#if ( configUSE_MUTEXES == 1 )
{
pxTaskStatusArray[ uxTask ].uxBasePriority = pxNextTCB->uxBasePriority;
pxTaskStatusArray[ uxTask ].uxMutexesHeld = pxNextTCB->uxMutexesHeld;
}
#else
{
pxTaskStatusArray[ uxTask ].uxBasePriority = 0;
pxTaskStatusArray[ uxTask ].uxMutexesHeld = 0;
}
#endif

Expand Down

0 comments on commit b501d31

Please sign in to comment.