title: Why is wait_event_interruptible() in Linux kernel never used in a while loop?
body: <p>Looking through the Linux kernel, I found the return value of <code>wait_event_interruptible()</code> is almost always checked by an <code>if</code>-block instead of a while loop:</p>
  <pre><code>if (mutex_lock_interruptible(lock)) {
    return -ERESTARTSYS;
  }
  </code></pre>
  <p>Why not check the return value in a while loop and keep trying even if the wait was interrupted by a signal handler? Why would the driver writer want to return <code>-ERESTARTSYS</code> for the system call to restart? Isn't this more expensive?</p>
  <pre><code>while (mutex_lock_interruptible(lock)) {
    // 
  }
  </code></pre>