XMR: there is no need for a slice thread, it also causes timing issues; BelowNormal mb 2 Below on win; cosmetics

This commit is contained in:
UbitUmarov
2018-02-03 08:08:59 +00:00
parent 20ca517887
commit 04a8ec518d
6 changed files with 353 additions and 237 deletions

View File

@@ -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<Thread,XMRScriptThread> m_AllThreads = new Dictionary<Thread,XMRScriptThread> ();
@@ -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;
}
}
/**