From: kwolekr Date: Sun, 24 Feb 2013 03:06:16 +0000 (-0500) Subject: Fix selection of # threads, set default to 1 thread X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=f00d136ab1523297fdf4707bbc5d40ec9d4f7afb;p=zefram%2Fminetest%2Fminetest_engine.git Fix selection of # threads, set default to 1 thread --- diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 0e82c4e2..4307f761 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -187,7 +187,7 @@ void set_default_settings(Settings *settings) settings->setDefault("emergequeue_limit_total", "256"); settings->setDefault("emergequeue_limit_diskonly", ""); settings->setDefault("emergequeue_limit_generate", ""); - settings->setDefault("num_emerge_threads", ""); + settings->setDefault("num_emerge_threads", "1"); // physics stuff settings->setDefault("movement_acceleration_default", "3"); diff --git a/src/emerge.cpp b/src/emerge.cpp index dd97734c..dc2bb3e9 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -56,8 +56,7 @@ EmergeManager::EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef) { if (g_settings->get("num_emerge_threads").empty()) { int nprocs = porting::getNumberOfProcessors(); // leave a proc for the main thread and one for some other misc threads - if (nprocs > 2) - nthreads = nprocs - 2; + nthreads = (nprocs > 2) ? nthreads = nprocs - 2 : 1; } else { nthreads = g_settings->getU16("num_emerge_threads"); }