mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 23:40:39 +00:00
20 lines
463 B
C++
20 lines
463 B
C++
#include "ThreadPools.h"
|
|
|
|
#include "../Core/Config.h"
|
|
|
|
std::shared_ptr<ThreadPool> GlobalThreadPool::pool;
|
|
bool GlobalThreadPool::initialized = false;
|
|
|
|
void GlobalThreadPool::Loop(const std::function<void(int,int)>& loop, int lower, int upper) {
|
|
Inititialize();
|
|
pool->ParallelLoop(loop, lower, upper);
|
|
}
|
|
|
|
void GlobalThreadPool::Inititialize() {
|
|
if(!initialized) {
|
|
pool = std::make_shared<ThreadPool>(g_Config.iNumWorkerThreads);
|
|
initialized = true;
|
|
}
|
|
}
|
|
|