#include <iostream>
#include <thread>
using namespace std;
void ThreadFunc1()
{
cout << "线程a" << endl;
this_thread::sleep_for(chrono::seconds(2));
cout << "线程b" << endl;
}
void ThreadFunc2()
{
cout << "线程a" << endl;
this_thread::sleep_for(chrono::seconds(4));
cout << "线程b" << endl;
}
int main()
{
thread th1(ThreadFunc1);
thread th2(ThreadFunc2);
th1.join();
th2.join();
return 0;
}