- /* Calculate the time at which the task should be woken if the event does\r
- not occur. This may overflow but this doesn't matter. */\r
- xTimeToWake = xTickCount + xTicksToWait;\r
+ /* If vTaskSuspend() is available then the suspended task list is also\r
+ available and a task that is blocking indefinitely can enter the\r
+ suspended state (it is not really suspended as it will re-enter the\r
+ Ready state when the event it is waiting indefinitely for occurs).\r
+ Blocking indefinitely is useful when using tickless idle mode as when\r
+ all tasks are blocked indefinitely all timers can be turned off. */\r
+ #if( INCLUDE_vTaskSuspend == 1 )\r
+ {\r
+ if( xWaitIndefinitely == pdTRUE )\r
+ {\r
+ /* Add the task to the suspended task list instead of a delayed\r
+ task list to ensure the task is not woken by a timing event. It\r
+ will block indefinitely. */\r
+ vListInsertEnd( &xSuspendedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
+ }\r
+ else\r
+ {\r
+ /* Calculate the time at which the task should be woken if the\r
+ event does not occur. This may overflow but this doesn't\r
+ matter. */\r
+ xTimeToWake = xTickCount + xTicksToWait;\r
+ traceTASK_DELAY_UNTIL();\r
+ prvAddCurrentTaskToDelayedList( xTimeToWake );\r
+ }\r
+ }\r
+ #else\r
+ {\r
+ /* Calculate the time at which the task should be woken if the event\r
+ does not occur. This may overflow but this doesn't matter. */\r
+ xTimeToWake = xTickCount + xTicksToWait;\r
+ traceTASK_DELAY_UNTIL();\r
+ prvAddCurrentTaskToDelayedList( xTimeToWake );\r