Bird
0
0

What is the effect of calling vTaskDelete(NULL) inside a FreeRTOS task during a shutdown sequence?

medium📝 Predict Output Q5 of 15
FreeRTOS - Design Patterns for RTOS
What is the effect of calling vTaskDelete(NULL) inside a FreeRTOS task during a shutdown sequence?
AAll tasks are deleted except the calling task
BThe calling task deletes itself and stops executing immediately
CThe scheduler is suspended but tasks continue running
DThe task enters a blocked state waiting for deletion
Step-by-Step Solution
Solution:
  1. Step 1: Understand vTaskDelete(NULL)

    Calling vTaskDelete with NULL deletes the currently running task.
  2. Step 2: Effect during shutdown

    The task stops immediately and frees its resources.
  3. Final Answer:

    The calling task deletes itself and stops executing immediately -> Option B
  4. Quick Check:

    vTaskDelete(NULL) self-terminates task [OK]
Quick Trick: NULL deletes the calling task itself [OK]
Common Mistakes:
  • Thinking it deletes all tasks
  • Assuming task blocks instead of deletes
  • Believing scheduler suspends automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes