title: Clean way to stop/terminating a thread waiting on stdin in C++
body: <p>I have got a thread which is waiting for user input. If my main function terminates, I want to notify the user-input-thread to terminate, so that I can join that thread. </p>
  
  <p>Is there a cleaner/better way than using interrupts?</p>