title: Waiting for a TThread to finish with WaitForSingleObject()
body: <p>I am creating a thread, and then say want to wait for it to terminate with a WFSO call (simplified pseudo-code below, obviously no one wants to wait on a thread right after creating it). </p>
  
  <pre><code>constructor TFileScannerThread.Create(Parameters)
  begin
  /// assign parameters to private variables, and call
  inherited Create(true);  //Create Suspended
  FreeOnTerminate := true; 
  Start; 
  end;
  </code></pre>
  
  <p>In the main thread</p>
  
  <pre><code>fst := TFileScannerThread.Create(BaseFolder, ScanMode, AbortEvent);
  
  ///  I presume, the next call would block the main thread until the child thread is done
  ///  but, it seems to create a deadlock &amp; WFSO never returns
  ///  I get a WAIT_TIMEOUT if I use a finite wait time
  WaitForsingleObject(fst.Handle, INFINITE);
  </code></pre>
  
  <p>What am I doing wrong/missing?  If I do not have the WFSO the thread completes in about 10 seconds.</p>
  
  <p>Edit: Creating with FreeOnTerminate=false does not create this issue. </p>