# Blocked task resumption from Suspended State

**URL:** <https://forums.freertos.org/t/blocked-task-resumption-from-suspended-state/8710>\
**Category:** Kernel\
**Created:** [January 29, 2020, 2:55am UTC](https://forums.freertos.org/t/blocked-task-resumption-from-suspended-state/8710 "2020-01-29T02:55:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://forums.freertos.org/u/warren)\
**Post date:** [January 29, 2020, 2:55am UTC](https://forums.freertos.org/t/blocked-task-resumption-from-suspended-state/8710/1 "2020-01-29T02:55:26Z")

</div>

I’m looking at the state diagram: [https://www.freertos.org/RTOS-task-states.html](https://www.freertos.org/RTOS-task-states.html)

The diagram shows that a resumed task goes from the Suspended to the Ready state. What if the suspended task was initially blocked on a semaphore before being suspended? Wouldn’t a task blocking on a semaphore return to the Blocked state? Or does the task fail in this case once it goes from Ready to Running?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 29, 2020, 3:12am UTC](https://forums.freertos.org/t/blocked-task-resumption-from-suspended-state/8710/2 "2020-01-29T03:12:03Z")

</div>

I believe the state diagram shows the transitions correctly - so into the Ready state - but there are subtitles.

If the task were previously in the Blocked state to, just as an example, wait for a message on a queue, when it exits the suspended state and enters the ready state it will still be inside the queue receive function. When it next enters the Running state, it will run, but if it finds the queue is still empty it will simply loop back and re-enter the Blocked state to wait the rest of its original block time. So it will never have left the queue receive function, and an observer would never really notice that it had made those transitions.

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://forums.freertos.org/u/warren)\
**Post date:** [January 29, 2020, 9:35pm UTC](https://forums.freertos.org/t/blocked-task-resumption-from-suspended-state/8710/3 "2020-01-29T21:35:42Z")

</div>

Thanks for clarifying. Your answer makes sense because the queue could have changed substantially since the task was suspended.
