vTaskDelete vs. vTaskSuspend

Let’s say we have a task which calls vTaskDelay()[0] for 5 seconds.

After 2 seconds we suspend the task via vTaskSuspend()[2] and after another 10 seconds, we resume it from another task via vTaskResume()[3].

The documentation says: “When suspended a task will never get any microcontroller processing time, no matter what it’s priority.”

But it does not mention anything about the task being removed from ready, blocked, suspended, and event lists, like described with vTaskDelete()[1].

So I assume that vTaskSuspend()[2] does not remove the task from those lists and the vTaskDelay()[0] is still being processed although the task is in the “suspended” state.

This would mean, that if we wait long enough for the vTaskDelay()[0] to expire and we call vTaskResume()[3] there should be no further delay and the task should be in a “Ready to run” state immediately.

I need to hack up an example to confirm my theory.

Just asking here if you agree with it or not.

[0] vTaskDelay: This page describes the RTOS vTaskDelay() FreeRTOS API function which is part of the RTOS task control API. FreeRTOS is a professional grade, small footprint, open source RTOS for microcontrollers.
[1] vTaskDelete: This page describes the RTOS vTaskDelete() FreeRTOS API function which is part of the RTOS task control API. FreeRTOS is a professional grade, small footprint, open source RTOS for microcontrollers.
[2] vTaskSuspend: This page describes the RTOS vTaskSuspend() FreeRTOS API function which is part of the RTOS scheduler control API. FreeRTOS is a professional grade, small footprint, open source RTOS for microcontrollers.
[3] vTaskResume: This page describes the RTOS vTaskResume() FreeRTOS API function which is part of the RTOS scheduler control API. FreeRTOS is a professional grade, small footprint, open source RTOS for microcontrollers.

A task at any point of time can only be on one list of the ready, delayed, or suspend tasks, plus one ‘event’ list. This is structural in how TCBs are defined, so suspending a task clears all delays for the task. It also re,over it from what ever event list it might be on.