title: Non-blocking pthread_join
body: <p>I'm coding the shutdown of a multithreaded server.If everything goes as it should all the threads exit by their own, but there's a small chance that a thread gets stuck.In this case it would be convenient to have a non-blocking join so I could do.</p>
  
  <p><strong>Is there a way of doing a non-blocking pthread_join?
  Some sort of timed join would be good too.</strong></p>
  
  <p>something like this:</p>
  
  <pre>
  foreach thread do
    nb_pthread_join();
      if still running
        pthread_cancel();
  </pre>
  
  <p>I can think more cases where a a non-bloking join would be useful.</p>
  
  <p>As it seems there is no such a function so I have already coded a workaround, but it's not as simple as I would like.</p>