Is std::thread (only usable with g++-4.5 I think) known to be broken?

The following program:

   #include <iostream>
   #include <thread>

   int g = 0;

   void f ()
   {
     g++;
   }

   int main ()
   {
     std::thread t (f);
     t.join ();
     std::cout << "after joing, g = " << g << std::endl;
     return 0;
   }

Dies with an exception:

   $ g++-4.5 --version
   g++-4.5 (Debian 4.5-20100227-1) 4.5.0 20100227 (experimental) [trunk 
revision 157109]

   $ g++-4.5 -std=c++0x -o t t.cc

   $ ./t
   terminate called after throwing an instance of 'std::system_error'
     what():  
   Aborted

Thanks,

-Miles

-- 
Saa, shall we dance?  (from a dance-class advertisement)


-- 
To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/buoaatnbwco....@dhlpc061.dev.necel.com

Reply via email to