title: Delayed start of a thread in C++ 11
body: <p>I'm getting into C++11 threads and have run into a problem.</p>
  
  <p>I want to declare a thread variable as global and start it later.</p>
  
  <p>However all the examples I've seen seem to start the thread immediately for example</p>
  
  <pre><code>thread t(doSomething);
  </code></pre>
  
  <p>What I want is </p>
  
  <pre><code>thread t;
  </code></pre>
  
  <p>and start the thread later.</p>
  
  <p>What I've tried is </p>
  
  <pre><code>if(!isThreadRunning)
  {
      thread t(readTable);
  }
  </code></pre>
  
  <p>but now t is block scope.  So I want to declare t and then start the thread later so that t is accessible to other functions.</p>
  
  <p>Thanks for any help.</p>