title: Windows C++ - closing thread with CloseHandle
body: <p>I have created a thread by the "CreateThread" function.</p>
  
  <p>in this thread, I have a 'while(true)' loop (that reads input).</p>
  
  <p>for now, when I want to close the thread, I use the 'CloseHandle' function.</p>
  
  <p>Is this the right thing to do? Or I should exit the 'while(true)' loop and then use the 'CloseHandle' function?</p>
  
  <p>Thanks</p>