Merge pull request #725 from knocte/threadpool_init
[mono.git] / mono / metadata / threadpool.c
index 70c4b07c16197aca79a0ff23e20fc6e993de09b9..8710dafd661e8d26ac41f99ec451bd617400a474 100644 (file)
@@ -19,6 +19,7 @@
 #include <mono/metadata/threadpool-internals.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/environment.h>
+#include <mono/metadata/mono-config.h>
 #include <mono/metadata/mono-mlist.h>
 #include <mono/metadata/mono-perfcounters.h>
 #include <mono/metadata/socket-io.h>
@@ -1071,8 +1072,10 @@ threadpool_append_jobs (ThreadPool *tp, MonoObject **jobs, gint njobs)
                }
                /* Create on demand up to min_threads to avoid startup penalty for apps that don't use
                 * the threadpool that much
-               * mono_thread_create_internal (mono_get_root_domain (), threadpool_start_idle_threads, tp, TRUE, FALSE, SMALL_STACK);
-               */
+                */
+               if (mono_config_is_server_mode ()) {
+                       mono_thread_create_internal (mono_get_root_domain (), threadpool_start_idle_threads, tp, TRUE, FALSE, SMALL_STACK);
+               }
        }
 
        for (i = 0; i < njobs; i++) {