代码:
#include <iostream>
#include <thread>
void f()
{
std::cout << "hi thread" << std::endl;
}
int main()
{
std::thread t(f);
std::cout << "hi" << std::endl;
t.join();
}
问题:
$ g++ -o thread_test thread_test.cpp -std=c++0x
$ ./thread_test
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted
Abortado
“Abortado”在我的语言环境中意味着“中止”。