Lucifer Poltergeist
Lucifer Poltergeist

Reputation: 31

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

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?

Upvotes: 0

Views: 225

Answers (0)

Related Questions