From 319069d193dc0c812bed40077a75935288f3f5cf Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Fri, 4 Jan 2013 08:43:05 +0200 Subject: Assign the SmartThreadPool name in the constructor This is required because some threads are created in the constructor, so assigning the name afterwards would be too late. --- OpenSim/Framework/Util.cs | 9 +++++++-- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 7204279..0bd2977 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1658,8 +1658,13 @@ namespace OpenSim.Framework if (m_ThreadPool != null) throw new InvalidOperationException("SmartThreadPool is already initialized"); - m_ThreadPool = new SmartThreadPool(2000, maxThreads, 2); - m_ThreadPool.Name = "Util"; + STPStartInfo startInfo = new STPStartInfo(); + startInfo.ThreadPoolName = "Util"; + startInfo.IdleTimeout = 2000; + startInfo.MaxWorkerThreads = maxThreads; + startInfo.MinWorkerThreads = 2; + + m_ThreadPool = new SmartThreadPool(startInfo); } public static int FireAndForgetCount() diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 8c3bb5b..4d06eec 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1486,7 +1486,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_MaxScriptQueue = maxScriptQueue; STPStartInfo startInfo = new STPStartInfo(); - startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini + startInfo.ThreadPoolName = "XEngine"; + startInfo.IdleTimeout = idleTimeout * 1000; // convert to seconds as stated in .ini startInfo.MaxWorkerThreads = maxThreads; startInfo.MinWorkerThreads = minThreads; startInfo.ThreadPriority = threadPriority;; @@ -1494,7 +1495,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine startInfo.StartSuspended = true; m_ThreadPool = new SmartThreadPool(startInfo); - m_ThreadPool.Name = "XEngine"; } // -- cgit v1.1