mirror of
https://github.com/opensim/opensim.git
synced 2026-07-04 01:40:07 +08:00
mantis 3315: change the control of script flag running (needs testing)
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Monitoring;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -60,9 +61,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
Thread thd;
|
||||
if(i >= 0)
|
||||
thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString() + " (" + sceneName +")", priority);
|
||||
thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString() + " (" + sceneName +")", priority, -1);
|
||||
else
|
||||
thd = Yengine.StartMyThread(RunScriptThread, "YScript", priority);
|
||||
thd = Yengine.StartMyThread(RunScriptThread, "YScript", priority, -1);
|
||||
lock(m_WakeUpLock)
|
||||
m_RunningInstances.Add(thd.ManagedThreadId, null);
|
||||
}
|
||||
@@ -122,6 +123,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
int tid = System.Threading.Thread.CurrentThread.ManagedThreadId;
|
||||
ThreadStart thunk;
|
||||
XMRInstance inst;
|
||||
|
||||
bool didevent;
|
||||
m_ScriptThreadTID = tid;
|
||||
|
||||
@@ -140,7 +142,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
else if(m_SuspendScriptThreadFlag && !m_Exiting)
|
||||
{
|
||||
Monitor.Wait(m_WakeUpLock, Watchdog.DEFAULT_WATCHDOG_TIMEOUT_MS / 2);
|
||||
Yengine.UpdateMyThread();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -193,6 +194,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
continue;
|
||||
if (inst.m_IState != XMRInstState.ONYIELDQ)
|
||||
throw new Exception("bad state");
|
||||
|
||||
RunInstance(inst, tid);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user