Configuration.Concurrency: default to 1 until Configuration freeze

not to start many threads before the user could override their amount (-D).
This commit is contained in:
Alexander A. Klimov 2023-05-11 16:55:47 +02:00
parent 8fb5d53118
commit 32eb1680f7
2 changed files with 5 additions and 1 deletions

View File

@ -447,6 +447,10 @@ static int Main()
Configuration::SetReadOnly(true);
if (!Configuration::ConcurrencyWasModified) {
Configuration::Concurrency = std::thread::hardware_concurrency();
}
/* Ensure that all defined constants work in the way we expect them. */
HandleLegacyDefines();

View File

@ -12,7 +12,7 @@ String Configuration::ApiBindHost;
String Configuration::ApiBindPort{"5665"};
bool Configuration::AttachDebugger{false};
String Configuration::CacheDir;
int Configuration::Concurrency{static_cast<int>(std::thread::hardware_concurrency())};
int Configuration::Concurrency{1};
bool Configuration::ConcurrencyWasModified{false};
String Configuration::ConfigDir;
String Configuration::DataDir;