Remove Timer.cpp/h. Move various collections into Common/Data/Collections.

This commit is contained in:
Henrik Rydgård 2020-10-05 20:58:33 +02:00
parent dd5a459e00
commit 886a8b1ac6
49 changed files with 152 additions and 445 deletions

16
Core/ThreadPools.cpp Normal file
View file

@ -0,0 +1,16 @@
#include "ThreadPools.h"
#include "../Core/Config.h"
#include "Common/MakeUnique.h"
std::unique_ptr<ThreadPool> GlobalThreadPool::pool;
std::once_flag GlobalThreadPool::init_flag;
void GlobalThreadPool::Loop(const std::function<void(int,int)>& loop, int lower, int upper) {
std::call_once(init_flag, Inititialize);
pool->ParallelLoop(loop, lower, upper);
}
void GlobalThreadPool::Inititialize() {
pool = make_unique<ThreadPool>(g_Config.iNumWorkerThreads);
}