| 58 | } |
| 59 | |
| 60 | void ParallelTaskManager::Initialize() |
| 61 | { |
| 62 | // Reserve threads. |
| 63 | unsigned int threadCount = g_GameFlow->GetSettings()->System.Multithreaded ? (GetCoreCount() * 2) : 1; |
| 64 | _threads.reserve(threadCount); |
| 65 | |
| 66 | // Create threads. |
| 67 | for (int i = 0; i < threadCount; i++) |
| 68 | _threads.push_back(std::thread(&ParallelTaskManager::Worker, this)); |
| 69 | } |
| 70 | |
| 71 | std::future<void> ParallelTaskManager::AddTask(const ParallelTask& task) |
| 72 | { |
no test coverage detected