64,654
社区成员
发帖
与我相关
我的任务
分享
int funA()
{
cout<<"funA is running !"<<endl;
return 0;
}
int funB(int n)
{
cout<<"funB is running "<<"n:"<<n<<endl;
return 0;
}
int main()
{
thread firstTh(funA);
thread secondTh(funB,1);
cout<<"thread first and second is running!"<<endl;
firstTh.join();
secondTh.join();
cout<<"main thread is running, first and second completed! "<<endl;
return 0;
}