Re: std::thread segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks!

That works for me, too.

Is it intended that -pthread is required for std::thread? Even if it is... I don't think "Segmentation fault" is that helpful an error message.

Matthew Lai


Timothy Brownawell wrote:
On Tue, 2009-04-14 at 14:24 -0700, Matthew Lai wrote:
I'm using my 4.4.0 SVN checked out a few days ago, and I tried to use C++0x's std::thread, but it kept segfaulting on me.

It did this to me too, some time with google turned up (besides this
message)
   http://gcc.gnu.org/ml/libstdc++/2009-02/txt00002.txt
which makes it looks like "-pthread" is needed. And giving that option
does indeed seem to make it work here.

This is on 64-bit Linux, x86-64 (Ubuntu 8.10).

-------------------------------------------------
#include <thread>

void t() {
}

int main() {
    std::thread t1(&t);

    t1.join();
}
-------------------------------------------------



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux