num_emerge_threads: Initialise value to cope with setting syntax error (#8396)

master
Paramat 2019-03-18 10:19:53 +00:00 committed by Loïc Blot
parent 77cfc4fcd1
commit c0fb5dd317
1 changed files with 3 additions and 3 deletions

View File

@ -128,10 +128,10 @@ EmergeManager::EmergeManager(Server *server)
enable_mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info"); enable_mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info");
// If unspecified, leave a proc for the main thread and one for s16 nthreads = 1;
// some other misc thread
s16 nthreads;
g_settings->getS16NoEx("num_emerge_threads", nthreads); g_settings->getS16NoEx("num_emerge_threads", nthreads);
// If automatic, leave a proc for the main thread and one for
// some other misc thread
if (nthreads == 0) if (nthreads == 0)
nthreads = Thread::getNumberOfProcessors() - 2; nthreads = Thread::getNumberOfProcessors() - 2;
if (nthreads < 1) if (nthreads < 1)