mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
if std:🧵:hardware_concurrency() is 0 use 2 threads. also -1 thread because we already have one thread from the main function
This commit is contained in:
parent
b4f808da74
commit
26cb83ed6c
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue