由浅入深
#include<thread>
#include<iostream>
using namespace std;
//无参线程
void thread_t1()
{
cout<<"hello c++11 thread"<<endl;
}
//带参线程
void thread_arg(const int a,const int b)
{
cout<< "a=" << a <<" b=" << b <<endl;
}
int main()
{
thread t(thread_t1);
thread_t1(thread_arg,5,6);
t.join(); //等待子线程结束
t1.join();
cout<<"this is main"<<endl;
return 0;
}