Tools/MMapsGenerator: Use system supported threads instead of hardcoded amount (#19255)

- Use unsigned int for thread count
- Use std::thread::hardware_concurrency() to try estimate available threads instead of hardcoded 3 threads by default
- Print thread count always regardless of using --threads switch or not
This commit is contained in:
Rochet2
2017-03-17 19:09:58 +01:00
committed by Shauren
parent c7ea1b97c2
commit 769bc15ba0
3 changed files with 9 additions and 7 deletions
+4 -2
View File
@@ -190,9 +190,11 @@ namespace MMAP
}
}
void MapBuilder::buildAllMaps(int threads)
void MapBuilder::buildAllMaps(unsigned int threads)
{
for (int i = 0; i < threads; ++i)
printf("Using %u threads to extract mmaps\n", threads);
for (unsigned int i = 0; i < threads; ++i)
{
_workerThreads.push_back(std::thread(&MapBuilder::WorkerThread, this));
}