diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a3f7736075..ef102165bc 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1971,6 +1971,11 @@ namespace OpenSim.Region.Framework.Scenes Interlocked.Add(ref m_scriptExecutionTime, ticks); } + public void AddScriptEvents(int cntr) + { + StatsReporter.addScriptEvents(cntr); + } + /// /// Returns the total execution time of all the scripts in the region since the last call /// (in milliseconds), and clears the value in preparation for the next call. diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 50b0cb5571..b650635de3 100755 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -783,7 +783,7 @@ namespace OpenSim.Region.Framework.Scenes public void addScriptEvents(int count) { - m_scriptEventsPerSecond += count; + Interlocked.Add(ref m_scriptEventsPerSecond, count); } public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs index 202da10c00..c24b2364ad 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs @@ -1705,6 +1705,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine inst.m_IState = XMRInstState.IDLE; Monitor.Exit(inst.m_QueueLock); } + m_Scene.AddScriptEvents(1); break; // Its m_SuspendCount > 0.