1
0
mirror of synced 2025-04-21 22:25:55 +03:00

Merge pull request #333 from stupedama/master

std:🧵:hardware_concurrency
This commit is contained in:
yhirose 2020-01-14 17:04:17 -05:00 committed by GitHub
commit f6db19959f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,9 @@
#endif
#ifndef CPPHTTPLIB_THREAD_POOL_COUNT
#define CPPHTTPLIB_THREAD_POOL_COUNT (std::thread::hardware_concurrency())
// if hardware_concurrency() outputs 0 we still wants to use threads for this.
// -1 because we have one thread already in the main function.
#define CPPHTTPLIB_THREAD_POOL_COUNT std::thread::hardware_concurrency() ? std::thread::hardware_concurrency()-1 : 2
#endif
/*