mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Use API identical to std classes where possible
This commit is contained in:
@ -29,10 +29,12 @@ CThreadHelper::CThreadHelper(std::vector<std::function<void()>> * Tasks, int Thr
|
||||
}
|
||||
void CThreadHelper::run()
|
||||
{
|
||||
boost::thread_group grupa;
|
||||
std::vector<boost::thread> group;
|
||||
for(int i=0;i<threads;i++)
|
||||
grupa.create_thread(std::bind(&CThreadHelper::processTasks,this));
|
||||
grupa.join_all();
|
||||
group.emplace_back(std::bind(&CThreadHelper::processTasks,this));
|
||||
|
||||
for (auto & thread : group)
|
||||
thread.join();
|
||||
|
||||
//thread group deletes threads, do not free manually
|
||||
}
|
||||
|
Reference in New Issue
Block a user