# details in xTaskResumeFromISR

**URL:** <https://forums.freertos.org/t/details-in-xtaskresumefromisr/3340>\
**Category:** Kernel\
**Created:** [July 27, 2010, 8:01am UTC](https://forums.freertos.org/t/details-in-xtaskresumefromisr/3340 "2010-07-27T08:01:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 27, 2010, 8:01am UTC](https://forums.freertos.org/t/details-in-xtaskresumefromisr/3340/1 "2010-07-27T08:01:23Z")

</div>

**[lyhlbyl](https://sourceforge.net/u/lyhlbyl/)** wrote on [Tuesday, July 27, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/939ed96c/#cef3):

In the implementation of xTaskResumeFromISR, it checks the state of scheduler. If the scheduler is not locked, it will change suspended list and ready list directly, otherwise only put the task, which is to be resume, in xPendingReadyList.

I don’t understand what’s the main concern for the state of scheduler, since this operation should be called from ISR.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [July 27, 2010, 3:58pm UTC](https://forums.freertos.org/t/details-in-xtaskresumefromisr/3340/2 "2010-07-27T15:58:04Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Tuesday, July 27, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/939ed96c/#81cb):

There are some point in the kernel which manipulate the scheduler state, which rather than disable interrupts for an extended period of time, will just disable the scheduler. If the interrupt routine attempted to change the state of a task, this could cause a corruption of the scheduler, so the need to move the task to the ready list is noted and handled after the original operation is completed.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 27, 2010, 5:39pm UTC](https://forums.freertos.org/t/details-in-xtaskresumefromisr/3340/3 "2010-07-27T17:39:46Z")

</div>

**[lyhlbyl](https://sourceforge.net/u/lyhlbyl/)** wrote on [Tuesday, July 27, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/939ed96c/#db7a):

Thanks richard!

I’ve got another question.&nbsp; Following is&nbsp; one comment in funciotn xTaskIsTaskSuspended:\*\*  
/\* Is it in the suspended list because it is in the  
Suspended state?&nbsp; It is possible to be in the suspended  
list because it is blocked on a task with no timeout  
specified. \*\*\*/

This scenario sounds reasonable. My question is what’s the entry function for this scenario? I searched for xSuspendedTaskList in task.c file. I can’t find relevent operations which may results in a blocked task stay in suspended queue. As the global varible xSuspendedTaskList is static, functions outside task.c file would not access it.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [July 27, 2010, 6:26pm UTC](https://forums.freertos.org/t/details-in-xtaskresumefromisr/3340/4 "2010-07-27T18:26:42Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Tuesday, July 27, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/939ed96c/#8779):

With a quick check of the source code, the function vTaskPlaceOnEventList check for indefinite timeouts and places these tasks on the suspended task list instead of the delayed task list. (so the task isn’t automatically awakened after a period of time). Thus any call to a blocking function with a timeout delay of portMAX\_DELAY that does block, will put the task on the xSuspendedTaskList (and will be removed when the block ends).
