From: richardbarry Date: Tue, 22 Oct 2013 09:30:58 +0000 (+0000) Subject: Added a little intelligence to eTaskGetState() so it can distinguish between a suspen... X-Git-Tag: V7.6.0~39 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7e75689e182bc08650af872ac3297d4c942532b8;p=freertos Added a little intelligence to eTaskGetState() so it can distinguish between a suspended task and a task that is indefinitely blocked on an event. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2068 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c index 48648d329..768c13358 100644 --- a/FreeRTOS/Source/tasks.c +++ b/FreeRTOS/Source/tasks.c @@ -844,8 +844,16 @@ tskTCB * pxNewTCB; else if( pxStateList == &xSuspendedTaskList ) { /* The task being queried is referenced from the suspended - list. */ - eReturn = eSuspended; + list. Is it genuinely suspended or is it block + indefinitely? */ + if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL ) + { + eReturn = eSuspended; + } + else + { + eReturn = eBlocked; + } } #endif