Yengine: try fix changing scripts running state if the have long events

This commit is contained in:
UbitUmarov
2019-04-01 13:58:41 +01:00
parent 3b63699b9d
commit 7f55db72d2
4 changed files with 96 additions and 23 deletions

View File

@@ -1535,15 +1535,38 @@ namespace OpenSim.Region.ScriptEngine.Yengine
*/
public void QueueToStart(XMRInstance inst)
{
if(inst.m_IState != XMRInstState.ONSTARTQ)
if (inst.m_IState != XMRInstState.ONSTARTQ)
throw new Exception("bad state");
lock(m_StartQueue)
lock (m_StartQueue)
m_StartQueue.InsertTail(inst);
WakeUpOne();
}
public void QueueToYield(XMRInstance inst)
{
if (inst.m_IState != XMRInstState.ONYIELDQ)
throw new Exception("bad state");
lock (m_YieldQueue)
m_YieldQueue.InsertTail(inst);
WakeUpOne();
}
public void RemoveFromSleep(XMRInstance inst)
{
lock (m_SleepQueue)
{
if (inst.m_IState != XMRInstState.ONSLEEPQ)
return;
m_SleepQueue.Remove(inst);
inst.m_IState = XMRInstState.REMDFROMSLPQ;
}
}
/**
* @brief A script may be sleeping, in which case we wake it.
*/