title: Will killed process/thread release mutex?
body: <p>Several processes access shared memory, locking it with the mutex and <code>pthread_mutex_lock()</code> for synchronization, and each process can be killed at any moment (in fact I described <code>php-fpm</code> with <code>APC</code> extension, but it doesn't matter).<br>
  Will the mutex be unlocked automatically, if the process locked the mutex and then was killed?<br>
  Or is there a way to unlock it automatically?</p>
  
  <p><strong>Edit:</strong> As it turns out, dying processes and threads have similar behavior in this situation, which depends on <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_setrobust.html" rel="noreferrer">robust attribute of mutex</a>.</p>