Qt/Core: implement max llvm compile threads

This commit is contained in:
Megamouse 2018-01-24 17:38:38 +01:00 committed by Ivan
parent c8965564e4
commit b9c10a186d
7 changed files with 34 additions and 19 deletions

View file

@ -1161,7 +1161,9 @@ extern void ppu_initialize(const ppu_module& info)
static semaphore<> jmutex;
// Initialize semaphore with the max number of threads
semaphore<INT32_MAX> jcores(std::thread::hardware_concurrency());
u32 max_threads = static_cast<u32>(g_cfg.core.llvm_threads);
s32 thread_count = max_threads > 0 ? std::min(max_threads, std::thread::hardware_concurrency()) : std::thread::hardware_concurrency();
semaphore<INT32_MAX> jcores(thread_count);
if (!jcores.get())
{