YEngine: reduce calls to CheckRunLockInvariants

This commit is contained in:
UbitUmarov
2023-08-22 18:37:17 +01:00
parent 28ffa3e2c0
commit 29b8191225
4 changed files with 9 additions and 23 deletions

View File

@@ -85,7 +85,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
lock(m_RunLock)
{
//m_RunOnePhase = "GetExecutionState enter";
CheckRunLockInvariants(true);
//CheckRunLockInvariants(true);
// Get copy of script globals and stack in relocateable form.
Byte[] snapshotBytes;
@@ -100,21 +100,18 @@ namespace OpenSim.Region.ScriptEngine.Yengine
snapshotN.AppendChild(doc.CreateTextNode(snapshotString));
scriptStateN.AppendChild(snapshotN);
//m_RunOnePhase = "GetExecutionState B";
CheckRunLockInvariants(true);
// "Running" says whether or not we are accepting new events.
XmlElement runningN = doc.CreateElement("", "Running", "");
runningN.AppendChild(doc.CreateTextNode(m_Running.ToString()));
scriptStateN.AppendChild(runningN);
//m_RunOnePhase = "GetExecutionState C";
CheckRunLockInvariants(true);
// "DoGblInit" says whether or not default:state_entry() will init global vars.
XmlElement doGblInitN = doc.CreateElement("", "DoGblInit", "");
doGblInitN.AppendChild(doc.CreateTextNode(doGblInit.ToString()));
scriptStateN.AppendChild(doGblInitN);
//m_RunOnePhase = "GetExecutionState D";
CheckRunLockInvariants(true);
if(m_XMRLSLApi is not null)
{
@@ -130,7 +127,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
minEventDelayN.AppendChild(doc.CreateTextNode(m_minEventDelay.ToString()));
scriptStateN.AppendChild(minEventDelayN);
//m_RunOnePhase = "GetExecutionState D";
CheckRunLockInvariants(true);
}
// More misc data.
@@ -145,7 +141,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
maskA.Value = m_Item.PermsMask.ToString();
permissionsN.Attributes.Append(maskA);
//m_RunOnePhase = "GetExecutionState E";
CheckRunLockInvariants(true);
// "DetectParams" are returned by llDetected...() script functions
// for the currently active event, if any.
@@ -157,7 +152,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
scriptStateN.AppendChild(detParArrayN);
}
//m_RunOnePhase = "GetExecutionState F";
CheckRunLockInvariants(true);
// Save any events we have in the queue.
// <EventQueue>
@@ -181,7 +175,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
}
scriptStateN.AppendChild(queuedEventsN);
//m_RunOnePhase = "GetExecutionState G";
CheckRunLockInvariants(true);
// "Plugins" indicate enabled timers and listens, etc.
Object[] pluginData = AsyncCommandManager.GetSerializationData(m_Engine, m_ItemID);
@@ -190,13 +183,11 @@ namespace OpenSim.Region.ScriptEngine.Yengine
AppendXMLObjectArray(doc, plugins, pluginData, "plugin");
scriptStateN.AppendChild(plugins);
//m_RunOnePhase = "GetExecutionState H";
CheckRunLockInvariants(true);
// Let script run again.
suspendOnCheckRunHold = false;
//m_RunOnePhase = "GetExecutionState leave";
CheckRunLockInvariants(true);
}
// scriptStateN represents the contents of the .state file so