mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Yengine: try fix changing scripts running state if the have long events
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user