mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-16 17:58:28 +00:00
Merge pull request #333 from stupedama/master
std:🧵:hardware_concurrency
This commit is contained in:
commit
f6db19959f
1 changed files with 3 additions and 1 deletions
|
@ -49,7 +49,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CPPHTTPLIB_THREAD_POOL_COUNT
|
#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
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue