title: Ruby ThreadsWait timeout
body: <p>I have the following code to block until all threads have finished (<a href="https://gist.github.com/mahemoff/ae386626923a1015a387" rel="nofollow">Gist</a>):</p>
  
  <pre><code>ThreadsWait.all_waits(*threads)
  </code></pre>
  
  <p>What's the simplest way to set a timeout here, ie kill any threads if they are still running after e.g. 3 seconds?</p>