mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
Use std::thread::hardware_concurrency, instead of Boost, to determine available cores
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <thread>
|
||||
|
||||
// Application startup time (used for uptime calculation)
|
||||
const int64_t nStartupTime = GetTime();
|
||||
@@ -891,11 +892,7 @@ bool SetupNetworking()
|
||||
|
||||
int GetNumCores()
|
||||
{
|
||||
#if BOOST_VERSION >= 105600
|
||||
return boost::thread::physical_concurrency();
|
||||
#else // Must fall back to hardware_concurrency, which unfortunately counts virtual cores
|
||||
return boost::thread::hardware_concurrency();
|
||||
#endif
|
||||
return std::thread::hardware_concurrency();
|
||||
}
|
||||
|
||||
std::string CopyrightHolders(const std::string& strPrefix)
|
||||
|
||||
Reference in New Issue
Block a user