title: Use of signal_pending_state function to change task's state to TASK_RUNNING
body: <p>I was going over through the main scheduling function: <code>__schedule()</code> and found a code snippet which is:</p>
  <pre class="lang-c prettyprint-override"><code>if (!preempt &amp;&amp; prev-&gt;state) {
          if (unlikely(signal_pending_state(prev-&gt;state, prev))) {
              prev-&gt;state = TASK_RUNNING;
      ...
  </code></pre>
  <p>Now, if a process voluntarily preempts itself by keeping itself onto the wait queue, why does the state of the process change again to <code>TASK_RUNNING</code>?</p>