mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-25 07:13:34 +01:00
Added Global Threadpool to common
This commit is contained in:
1 parent
af68180319
commit
0ef103525f
7 files changed
+44
-7
No files matched your search
@@ -0,0 +1,19 @@
|
||||
#include "ThreadPool.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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user