参考上说thread::join会阻断调用它的线程,那下面的代码是执行完t1才执行t2吗?
thread t1(fun);
thread t2(fun);
thread t3(fun);
thread t4(fun);
thread t5(fun);
t1.join();
t2.join();
t3.join();
t4.join();
t5.join();
上面的代码和下面的代码有什么区别?
thread t1(fun);
t1.join();
thread t2(fun);
t2.join();
thread t3(fun);
t3.join();
thread t4(fun);
t4.join();
thread t5(fun);
t5.join();
我在vs2019上测试出好像不同,这是为什么?