diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs index 5dcaa8fc39..f4cbc1fc33 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs @@ -122,7 +122,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine public XMRInstQueue m_YieldQueue = new XMRInstQueue(); public XMRInstQueue m_SleepQueue = new XMRInstQueue(); private string m_LockedDict = "nobody"; - + private ThreadPriority m_workersPrio; public Yengine() { } @@ -250,43 +250,29 @@ namespace OpenSim.Region.ScriptEngine.Yengine return; } - ThreadPriority workersPrio = ThreadPriority.Normal; + m_workersPrio = ThreadPriority.Normal; switch (priority) { case "Lowest": - workersPrio = ThreadPriority.Lowest; + m_workersPrio = ThreadPriority.Lowest; break; case "BelowNormal": - workersPrio = ThreadPriority.BelowNormal; + m_workersPrio = ThreadPriority.BelowNormal; break; case "Normal": - workersPrio = ThreadPriority.Normal; + m_workersPrio = ThreadPriority.Normal; break; case "AboveNormal": - workersPrio = ThreadPriority.AboveNormal; + m_workersPrio = ThreadPriority.AboveNormal; break; case "Highest": - workersPrio = ThreadPriority.Highest; + m_workersPrio = ThreadPriority.Highest; break; default: m_log.ErrorFormat("[YEngine] Invalid thread priority: '{0}'. Assuming Normal", priority); break; } - m_SleepThread = StartMyThread(RunSleepThread, "Yengine sleep", ThreadPriority.Normal); - for(int i = 0; i < numThreadScriptWorkers; i++) - StartThreadWorker(i, workersPrio); - m_log.InfoFormat("[YEngine]: Enabled, {0}.{1} Meg (0x{2}) stacks", - (m_StackSize >> 20).ToString(), - (((m_StackSize % 0x100000) * 1000) - >> 20).ToString("D3"), - m_StackSize.ToString("X")); - - m_log.InfoFormat("[YEngine]: ... {0}.{1} Meg (0x{2}) heaps", - (m_HeapSize >> 20).ToString(), - (((m_HeapSize % 0x100000) * 1000) - >> 20).ToString("D3"), - m_HeapSize.ToString("X")); m_MaintenanceInterval = m_Config.GetInt("MaintenanceInterval", 10); @@ -323,6 +309,22 @@ namespace OpenSim.Region.ScriptEngine.Yengine Directory.CreateDirectory(m_ScriptBasePath); + string sceneName = m_Scene.Name; + + m_log.InfoFormat("[YEngine]: Enabled for region {0}", sceneName); + + m_log.InfoFormat("[YEngine]: {0}.{1}MB stacksize, {2}.{3}MB heapsize", + (m_StackSize >> 20).ToString(), + (((m_StackSize % 0x100000) * 1000) + >> 20).ToString("D3"), + (m_HeapSize >> 20).ToString(), + (((m_HeapSize % 0x100000) * 1000) + >> 20).ToString("D3")); + + m_SleepThread = StartMyThread(RunSleepThread, "Yengine sleep" + " (" + sceneName + ")", ThreadPriority.Normal); + for (int i = 0; i < numThreadScriptWorkers; i++) + StartThreadWorker(i, m_workersPrio, sceneName); + m_Scene.EventManager.OnRezScript += OnRezScript; m_Scene.StackModuleInterface(this); diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs index c71eb81648..27312f2917 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs @@ -56,11 +56,11 @@ namespace OpenSim.Region.ScriptEngine.Yengine } } - public void StartThreadWorker(int i, ThreadPriority priority) + public void StartThreadWorker(int i, ThreadPriority priority, string sceneName) { Thread thd; if(i >= 0) - thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString(), priority); + thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString() + " (" + sceneName +")", priority); else thd = Yengine.StartMyThread(RunScriptThread, "YScript", priority); lock(m_WakeUpLock)