Use of signal_pending_state function to change task's state to TASK_RUNNING

220 Views Asked by At

I was going over through the main scheduling function: __schedule() and found a code snippet which is:

if (!preempt && prev->state) {
        if (unlikely(signal_pending_state(prev->state, prev))) {
            prev->state = TASK_RUNNING;
    ...

Now, if a process voluntarily preempts itself by keeping itself onto the wait queue, why does the state of the process change again to TASK_RUNNING?

0

There are 0 best solutions below