title: Kill a blocked Boost::Thread
body: <p>I am writing an application which blocks on input from two <code>istreams</code>.</p>
  
  <p>Reading from either <code>istream</code> is a synchronous (blocking) call, so, I decided to create two <code>Boost::thread</code>s to do the reading.</p>
  
  <p>Either one of these threads can get to the "end" (based on some input received), and once the "end" is reached, both input streams stop receiving.  Unfortunately, I cannot know which will do so.</p>
  
  <p>Thus, I cannot <code>join()</code> on both threads, because only one thread (cannot be predetermined which one) will actually return (unblock).</p>
  
  <p>I must somehow force the other to exit, but it is blocked waiting for input, so it cannot itself decide it is time to return (condition variables or what not).</p>
  
  <p>Is their a way to either:</p>
  
  <ul>
  <li>Send a signal a boost::thread, or</li>
  <li>Force an <code>istream</code> to "fail", or</li>
  <li>Kill a Boost::thread?</li>
  </ul>
  
  <p>Note:</p>
  
  <ul>
  <li>One of the <code>istreams</code> is <code>cin</code></li>
  <li>I am trying to restart the process, so I cannot close the input streams in a way that prohibits reseting them.</li>
  </ul>
  
  <p>Edit:</p>
  
  <ul>
  <li>I do know when the "end" is reached, and I do know which thread has successfully finished, and which needs to be killed.  Its the killing I need to figure out (or a different strategy for reading from an istream).</li>
  <li>I need both threads to exit and cleanup properly :(</li>
  </ul>
  
  <p>Thanks!</p>