From 04a8ec518d5d7d8b69b62cd31c192c60d953b6df Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 3 Feb 2018 08:08:59 +0000 Subject: XMR: there is no need for a slice thread, it also causes timing issues; BelowNormal mb 2 Below on win; cosmetics --- .../Region/ScriptEngine/XMREngine/XMRScriptThread.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XMREngine/XMRScriptThread.cs') diff --git a/OpenSim/Region/ScriptEngine/XMREngine/XMRScriptThread.cs b/OpenSim/Region/ScriptEngine/XMREngine/XMRScriptThread.cs index 933b478..a1238db 100644 --- a/OpenSim/Region/ScriptEngine/XMREngine/XMRScriptThread.cs +++ b/OpenSim/Region/ScriptEngine/XMREngine/XMRScriptThread.cs @@ -39,7 +39,8 @@ namespace OpenSim.Region.ScriptEngine.XMREngine * Each sits in a loop checking the Start and Yield queues for * a script to run and calls the script as a microthread. */ - public class XMRScriptThread { + public class XMRScriptThread + { private static int m_WakeUpOne = 0; public static object m_WakeUpLock = new object(); private static Dictionary m_AllThreads = new Dictionary (); @@ -81,10 +82,11 @@ namespace OpenSim.Region.ScriptEngine.XMREngine { engine = eng; m_Continuations = engine.uThreadCtor.DeclaringType == typeof (ScriptUThread_Con); - thd = XMREngine.StartMyThread (RunScriptThread, "xmrengine script", ThreadPriority.BelowNormal); - lock (m_AllThreads) { +// thd = XMREngine.StartMyThread (RunScriptThread, "xmrengine script", ThreadPriority.BelowNormal); + thd = XMREngine.StartMyThread (RunScriptThread, "xmrengine script", ThreadPriority.Normal); + lock (m_AllThreads) m_AllThreads.Add (thd, this); - } + } public void SuspendThread() @@ -104,18 +106,17 @@ namespace OpenSim.Region.ScriptEngine.XMREngine m_Exiting = true; WakeUpScriptThread(); thd.Join(); - lock (m_AllThreads) { + lock (m_AllThreads) m_AllThreads.Remove (thd); - } + thd = null; } public void TimeSlice() { XMRInstance instance = m_RunInstance; - if (instance != null) { + if (instance != null) instance.suspendOnCheckRunTemp = true; - } } /** -- cgit v1.1