From 2f394b7e7ebf991c7a70f93bf251d26d8043aaa2 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 22 Oct 2009 01:30:12 -0700 Subject: * Allow SmartThreadPool to be initialized without setting max stack size (like the original implementation) * Only initialize Util's SmartThreadPool if it is actually being used * No longer initializing Util's SmartThreadPool with a custom max stack size. From MSDN: "Avoid using this constructor overload. The default stack size used by the Thread(ThreadStart) constructor overload is the recommended stack size for threads." --- OpenSim/Region/Application/OpenSim.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index c04b8c2..26298e7 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -67,7 +67,7 @@ namespace OpenSim IConfig startupConfig = m_config.Source.Configs["Startup"]; - Util.SetMaxThreads(startupConfig.GetInt("MaxPoolThreads", 15)); + int stpMaxThreads = 15; if (startupConfig != null) { @@ -100,8 +100,13 @@ namespace OpenSim FireAndForgetMethod asyncCallMethod; if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse(asyncCallMethodStr, out asyncCallMethod)) Util.FireAndForgetMethod = asyncCallMethod; + + stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); } + if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) + Util.InitThreadPool(stpMaxThreads); + m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod); } -- cgit v1.1