title: How to check if a std::thread is still running?
body: <p>How can I check if a <code>std::thread</code> is still running (in a platform independent way)?
  It lacks a <code>timed_join()</code> method and <code>joinable()</code> is not meant for that.</p>
  
  <p>I thought of locking a mutex with a <code>std::lock_guard</code> in the thread and using the <code>try_lock()</code> method of the mutex to determine if it is still locked (the thread is running), but it seems unnecessarily complex to me.</p>
  
  <p>Do you know a more elegant method?</p>
  
  <p><strong>Update:</strong> To be clear: I want to check if the thread cleanly exited or not. A 'hanging' thread is considered running for this purpose.</p>