I have the following code:
我有以下代码:
void do_join(std::thread& t)
{
t.join();
}
void join_all(std::vector<std::thread>& v)
{
std::for_each(v.begin(),v.end(),do_join);
}
int main()
{
std::vector<std::thread> myThreads;
for(int i = 1; i <= 3; i++)
{
myThreads.push_back(std::thread(threadMethod));
}
join_all(myThreads);
}
void do_