From 7e75689e182bc08650af872ac3297d4c942532b8 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Tue, 22 Oct 2013 09:30:58 +0000 Subject: [PATCH] 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 --- FreeRTOS/Source/tasks.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 -- 2.39.5