title: Sleeping while holding a mutex in linux kernel
body: <p>What happens if a process sleeps while holding a mutex? For example, if i have the following code:</p>
  
  <pre><code>mutex_lock(mtx);
  wait_event_unterruptible_timeout(wait_queue_head, condition, timeout);
  //some other code
  mutex_unlock(mtx);
  </code></pre>
  
  <p>Is the mutex released while sleeping and re-aquired before the process wakes up? Or does the process keep holding the mutex while sleeping? </p>
  
  <p>Thank you</p>