title: Why does this simple std::thread example not work?
body: <p>Tried the following example compiled with <code>g++ -std=gnu++0x t1.cpp</code> and <code>g++ -std=c++0x t1.cpp</code> but both of these result in the example aborting.</p>
  
  <pre><code>$ ./a.out 
  terminate called after throwing an instance of 'std::system_error'
    what():  
  Aborted
  </code></pre>
  
  <p>Here is the sample:</p>
  
  <pre><code>#include &lt;thread&gt;
  #include &lt;iostream&gt;
  
  void doSomeWork( void )
  {
      std::cout &lt;&lt; "hello from thread..." &lt;&lt; std::endl;
      return;
  }
  
  int main( int argc, char *argv[] )
  {
      std::thread t( doSomeWork );
      t.join();
      return 0;
  }
  </code></pre>
  
  <p>I'm trying this on Ubuntu 11.04:</p>
  
  <pre><code>$ g++ --version
  g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
  </code></pre>
  
  <p>Anyone knows what I've missed?</p>