mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Yengine: comment out some debug debug exec state
This commit is contained in:
@@ -271,47 +271,47 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
m_SliceStart = Util.GetTimeStampMS();
|
||||
|
||||
// If script has called llSleep(), don't do any more until time is up.
|
||||
m_RunOnePhase = "check m_SleepUntil";
|
||||
//m_RunOnePhase = "check m_SleepUntil";
|
||||
if(m_SleepUntil > now)
|
||||
{
|
||||
m_RunOnePhase = "return is sleeping";
|
||||
//m_RunOnePhase = "return is sleeping";
|
||||
return XMRInstState.ONSLEEPQ;
|
||||
}
|
||||
|
||||
// Also, someone may have called Suspend().
|
||||
m_RunOnePhase = "check m_SuspendCount";
|
||||
//m_RunOnePhase = "check m_SuspendCount";
|
||||
if(m_SuspendCount > 0)
|
||||
{
|
||||
m_RunOnePhase = "return is suspended";
|
||||
//m_RunOnePhase = "return is suspended";
|
||||
return XMRInstState.SUSPENDED;
|
||||
}
|
||||
|
||||
// Make sure we aren't being migrated in or out and prevent that
|
||||
// whilst we are in here. If migration has it locked, don't call
|
||||
// back right away, delay a bit so we don't get in infinite loop.
|
||||
m_RunOnePhase = "lock m_RunLock";
|
||||
//m_RunOnePhase = "lock m_RunLock";
|
||||
if(!Monitor.TryEnter(m_RunLock))
|
||||
{
|
||||
m_SleepUntil = now.AddMilliseconds(15);
|
||||
m_RunOnePhase = "return was locked";
|
||||
//m_RunOnePhase = "return was locked";
|
||||
return XMRInstState.ONSLEEPQ;
|
||||
}
|
||||
try
|
||||
{
|
||||
m_RunOnePhase = "check entry invariants";
|
||||
//m_RunOnePhase = "check entry invariants";
|
||||
CheckRunLockInvariants(true);
|
||||
Exception e = null;
|
||||
|
||||
// Maybe it has been Disposed()
|
||||
if(m_Part == null || m_Part.Inventory == null)
|
||||
{
|
||||
m_RunOnePhase = "runone saw it disposed";
|
||||
//m_RunOnePhase = "runone saw it disposed";
|
||||
return XMRInstState.DISPOSED;
|
||||
}
|
||||
|
||||
if(!m_Running)
|
||||
{
|
||||
m_RunOnePhase = "return is not running";
|
||||
//m_RunOnePhase = "return is not running";
|
||||
return XMRInstState.SUSPENDED;
|
||||
}
|
||||
|
||||
@@ -324,13 +324,13 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
m_Suspended = true;
|
||||
m_DetachReady.Set();
|
||||
m_RunOnePhase = "detach quantum went zero";
|
||||
//m_RunOnePhase = "detach quantum went zero";
|
||||
CheckRunLockInvariants(true);
|
||||
return XMRInstState.FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
m_RunOnePhase = "resume old event handler";
|
||||
//m_RunOnePhase = "resume old event handler";
|
||||
m_LastRanAt = now;
|
||||
m_InstEHSlice++;
|
||||
callMode = CallMode_NORMAL;
|
||||
@@ -341,7 +341,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// processing it.
|
||||
else
|
||||
{
|
||||
m_RunOnePhase = "lock event queue";
|
||||
//m_RunOnePhase = "lock event queue";
|
||||
EventParams evt = null;
|
||||
ScriptEventCode evc = ScriptEventCode.None;
|
||||
|
||||
@@ -358,12 +358,12 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
|
||||
if(m_Suspended)
|
||||
{
|
||||
m_RunOnePhase = "m_Suspended is set";
|
||||
//m_RunOnePhase = "m_Suspended is set";
|
||||
CheckRunLockInvariants(true);
|
||||
return XMRInstState.FINISHED;
|
||||
}
|
||||
|
||||
m_RunOnePhase = "dequeue event";
|
||||
//m_RunOnePhase = "dequeue event";
|
||||
if(m_EventQueue.First != null)
|
||||
{
|
||||
evt = m_EventQueue.First.Value;
|
||||
@@ -378,7 +378,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
m_Suspended = true;
|
||||
m_DetachReady.Set();
|
||||
m_DetachQuantum = 0;
|
||||
m_RunOnePhase = "nothing to do #3";
|
||||
//m_RunOnePhase = "nothing to do #3";
|
||||
CheckRunLockInvariants(true);
|
||||
return XMRInstState.FINISHED;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
m_DetachReady.Set();
|
||||
m_DetachQuantum = 0;
|
||||
}
|
||||
m_RunOnePhase = "nothing to do #4";
|
||||
//m_RunOnePhase = "nothing to do #4";
|
||||
CheckRunLockInvariants(true);
|
||||
return XMRInstState.FINISHED;
|
||||
}
|
||||
@@ -408,21 +408,21 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
|
||||
// Dequeued an event, so start it going until it either
|
||||
// finishes or it calls CheckRun().
|
||||
m_RunOnePhase = "start event handler";
|
||||
//m_RunOnePhase = "start event handler";
|
||||
m_DetectParams = evt.DetectParams;
|
||||
m_LastRanAt = now;
|
||||
m_InstEHEvent++;
|
||||
e = StartEventHandler(evc, evt.Params);
|
||||
}
|
||||
m_RunOnePhase = "done running";
|
||||
//m_RunOnePhase = "done running";
|
||||
m_CPUTime += DateTime.UtcNow.Subtract(now).TotalMilliseconds;
|
||||
|
||||
// Maybe it puqued.
|
||||
if(e != null)
|
||||
{
|
||||
m_RunOnePhase = "handling exception " + e.Message;
|
||||
//m_RunOnePhase = "handling exception " + e.Message;
|
||||
HandleScriptException(e);
|
||||
m_RunOnePhase = "return had exception " + e.Message;
|
||||
//m_RunOnePhase = "return had exception " + e.Message;
|
||||
CheckRunLockInvariants(true);
|
||||
return XMRInstState.FINISHED;
|
||||
}
|
||||
@@ -434,22 +434,22 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_RunOnePhase += "; checking exit invariants and unlocking";
|
||||
//m_RunOnePhase += "; checking exit invariants and unlocking";
|
||||
CheckRunLockInvariants(false);
|
||||
Monitor.Exit(m_RunLock);
|
||||
}
|
||||
|
||||
// Cycle script through the yield queue and call it back asap.
|
||||
m_RunOnePhase = "last return";
|
||||
//m_RunOnePhase = "last return";
|
||||
return XMRInstState.ONYIELDQ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Immediately after taking m_RunLock or just before releasing it, check invariants.
|
||||
*/
|
||||
private ScriptEventCode lastEventCode = ScriptEventCode.None;
|
||||
private bool lastActive = false;
|
||||
private string lastRunPhase = "";
|
||||
//private ScriptEventCode lastEventCode = ScriptEventCode.None;
|
||||
//private bool lastActive = false;
|
||||
//private string lastRunPhase = "";
|
||||
|
||||
public void CheckRunLockInvariants(bool throwIt)
|
||||
{
|
||||
@@ -462,14 +462,14 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
m_log.Error("CheckRunLockInvariants: script=" + m_DescName);
|
||||
m_log.Error("CheckRunLockInvariants: eventcode=" + ec.ToString() + ", active=" + active.ToString());
|
||||
m_log.Error("CheckRunLockInvariants: m_RunOnePhase=" + m_RunOnePhase);
|
||||
m_log.Error("CheckRunLockInvariants: lastec=" + lastEventCode + ", lastAct=" + lastActive + ", lastPhase=" + lastRunPhase);
|
||||
//m_log.Error("CheckRunLockInvariants: m_RunOnePhase=" + m_RunOnePhase);
|
||||
//m_log.Error("CheckRunLockInvariants: lastec=" + lastEventCode + ", lastAct=" + lastActive + ", lastPhase=" + lastRunPhase);
|
||||
if(throwIt)
|
||||
throw new Exception("CheckRunLockInvariants: eventcode=" + ec.ToString() + ", active=" + active.ToString());
|
||||
}
|
||||
lastEventCode = ec;
|
||||
lastActive = active;
|
||||
lastRunPhase = m_RunOnePhase;
|
||||
//lastEventCode = ec;
|
||||
//lastActive = active;
|
||||
//lastRunPhase = m_RunOnePhase;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -546,14 +546,14 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
else if(e is ScriptDieException)
|
||||
{
|
||||
// Script did an llDie()
|
||||
m_RunOnePhase = "dying...";
|
||||
//m_RunOnePhase = "dying...";
|
||||
m_SleepUntil = DateTime.MaxValue;
|
||||
m_Engine.World.DeleteSceneObject(m_Part.ParentGroup, false);
|
||||
}
|
||||
else if (e is ScriptResetException)
|
||||
{
|
||||
// Script did an llResetScript().
|
||||
m_RunOnePhase = "resetting...";
|
||||
//m_RunOnePhase = "resetting...";
|
||||
ResetLocked("HandleScriptResetException");
|
||||
}
|
||||
else if (e is ScriptException)
|
||||
@@ -871,21 +871,21 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
*/
|
||||
private void ResetLocked(string from)
|
||||
{
|
||||
m_RunOnePhase = "ResetLocked: releasing controls";
|
||||
//m_RunOnePhase = "ResetLocked: releasing controls";
|
||||
ReleaseControlsOrPermissions(true);
|
||||
m_Part.CollisionSound = UUID.Zero;
|
||||
|
||||
if (m_XMRLSLApi != null)
|
||||
m_XMRLSLApi.llResetTime();
|
||||
|
||||
m_RunOnePhase = "ResetLocked: removing script";
|
||||
//m_RunOnePhase = "ResetLocked: removing script";
|
||||
IUrlModule urlModule = m_Engine.World.RequestModuleInterface<IUrlModule>();
|
||||
if(urlModule != null)
|
||||
urlModule.ScriptRemoved(m_ItemID);
|
||||
|
||||
AsyncCommandManager.RemoveScript(m_Engine, m_LocalID, m_ItemID);
|
||||
|
||||
m_RunOnePhase = "ResetLocked: clearing current event";
|
||||
//m_RunOnePhase = "ResetLocked: clearing current event";
|
||||
this.eventCode = ScriptEventCode.None; // not processing an event
|
||||
m_DetectParams = null; // not processing an event
|
||||
m_SleepUntil = DateTime.MinValue; // not doing llSleep()
|
||||
@@ -904,9 +904,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// If the script is being reset by something else, we throw them away cuz we want to start from the beginning of an event handler.
|
||||
stackFrames = null;
|
||||
|
||||
// Set script to 'default' state and queue call to its
|
||||
// 'state_entry()' event handler.
|
||||
m_RunOnePhase = "ResetLocked: posting default:state_entry() event";
|
||||
// Set script to 'default' state and queue call to its
|
||||
// 'state_entry()' event handler.
|
||||
//m_RunOnePhase = "ResetLocked: posting default:state_entry() event";
|
||||
stateCode = 0;
|
||||
m_Part.RemoveScriptTargets(m_ItemID);
|
||||
m_Part.SetScriptEvents(m_ItemID, GetStateEventFlags(0));
|
||||
@@ -917,7 +917,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// Tell CheckRun() to let script run.
|
||||
suspendOnCheckRunHold = false;
|
||||
suspendOnCheckRunTemp = false;
|
||||
m_RunOnePhase = "ResetLocked: reset complete";
|
||||
//m_RunOnePhase = "ResetLocked: reset complete";
|
||||
}
|
||||
|
||||
private void ReleaseControlsOrPermissions(bool fullPermissions)
|
||||
@@ -964,19 +964,19 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
return;
|
||||
suspendOnCheckRunTemp = true;
|
||||
}
|
||||
m_CheckRunPhase = "entered";
|
||||
//m_CheckRunPhase = "entered";
|
||||
|
||||
// Stay stuck in this loop as long as something wants us suspended.
|
||||
while(suspendOnCheckRunHold || suspendOnCheckRunTemp)
|
||||
{
|
||||
m_CheckRunPhase = "top of while";
|
||||
//m_CheckRunPhase = "top of while";
|
||||
suspendOnCheckRunTemp = false;
|
||||
|
||||
switch(this.callMode)
|
||||
{
|
||||
// Now we are ready to suspend or resume.
|
||||
case CallMode_NORMAL:
|
||||
m_CheckRunPhase = "suspending";
|
||||
//m_CheckRunPhase = "suspending";
|
||||
callMode = XMRInstance.CallMode_SAVE;
|
||||
stackFrames = null;
|
||||
throw new StackHibernateException(); // does not return
|
||||
@@ -996,10 +996,10 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
throw new Exception("callMode=" + callMode);
|
||||
}
|
||||
|
||||
m_CheckRunPhase = "resumed";
|
||||
//m_CheckRunPhase = "resumed";
|
||||
}
|
||||
|
||||
m_CheckRunPhase = "returning";
|
||||
//m_CheckRunPhase = "returning";
|
||||
|
||||
// Upon return from CheckRun() it should always be the case that the script is
|
||||
// going to process calls normally, neither saving nor restoring stack frame state.
|
||||
|
||||
Reference in New Issue
Block a user