title: Terminate one thread (that is stuck) from another
body: <p>Using only standard C++ (no platform specific API), I would like to launch an external application that may complete immediately or timeout. If the application halts, my app has a timeout after which it simply terminates the app and relaunches it.</p>
  
  <p>Now, down to the nitty gritty, I tried launching two threads:</p>
  
  <ul>
  <li>first thread launches the app and waits for it to terminate</li>
  <li>second thread waits for a few seconds and checks if the first thread terminated. If it did not, then it considers it as stalled.</li>
  </ul>
  
  <p>Question is, how do I terminate the first thread from the second? The way I'm launching the app is using the system() function. It's synchronous so there isn't any way for me to check from that thread if I wish for termination. It has to be forced somehow through an exception, externally.</p>
  
  <p>How is this done properly?7</p>
  
  <p>P.S.: if this is not possible, and I suspect it isn't, then I simply do not wish to wait for that thread anymore. It can simply remain stalled in the background. How do I achieve that? (currently, I'm waiting for that thread with a <code>join()</code>)</p>