mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
17 lines
466 B
C++
17 lines
466 B
C++
#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);
|
|
}
|