#include "ThreadPools.h" #include "../Core/Config.h" std::shared_ptr GlobalThreadPool::pool; bool GlobalThreadPool::initialized = false; void GlobalThreadPool::Loop(const std::function& loop, int lower, int upper) { Inititialize(); pool->ParallelLoop(loop, lower, upper); } void GlobalThreadPool::Inititialize() { if(!initialized) { pool = std::make_shared(g_Config.iNumWorkerThreads); initialized = true; } }