Remove unnecessary m_scenes and m_scene from AsyncCommandManager.

These were private and the sole point of use (to know when to load config for the first time) can be done by looking at script engines instead.
cpu-performance
Justin Clark-Casey (justincc) 2013-05-31 23:00:10 +01:00
parent 921ad8704e
commit 217c7d1140
1 changed files with 1 additions and 6 deletions

View File

@ -61,12 +61,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// </remarks> /// </remarks>
private static object staticLock = new object(); private static object staticLock = new object();
private static List<IScene> m_Scenes = new List<IScene>();
private static List<IScriptEngine> m_ScriptEngines = private static List<IScriptEngine> m_ScriptEngines =
new List<IScriptEngine>(); new List<IScriptEngine>();
public IScriptEngine m_ScriptEngine; public IScriptEngine m_ScriptEngine;
private IScene m_Scene;
private static Dictionary<IScriptEngine, Dataserver> m_Dataserver = private static Dictionary<IScriptEngine, Dataserver> m_Dataserver =
new Dictionary<IScriptEngine, Dataserver>(); new Dictionary<IScriptEngine, Dataserver>();
@ -147,7 +145,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public AsyncCommandManager(IScriptEngine _ScriptEngine) public AsyncCommandManager(IScriptEngine _ScriptEngine)
{ {
m_ScriptEngine = _ScriptEngine; m_ScriptEngine = _ScriptEngine;
m_Scene = m_ScriptEngine.World;
// If there is more than one scene in the simulator or multiple script engines are used on the same region // If there is more than one scene in the simulator or multiple script engines are used on the same region
// then more than one thread could arrive at this block of code simultaneously. However, it cannot be // then more than one thread could arrive at this block of code simultaneously. However, it cannot be
@ -155,11 +152,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// race conditions such as the later check of cmdHandlerThread == null. // race conditions such as the later check of cmdHandlerThread == null.
lock (staticLock) lock (staticLock)
{ {
if (m_Scenes.Count == 0) if (m_ScriptEngines.Count == 0)
ReadConfig(); ReadConfig();
if (!m_Scenes.Contains(m_Scene))
m_Scenes.Add(m_Scene);
if (!m_ScriptEngines.Contains(m_ScriptEngine)) if (!m_ScriptEngines.Contains(m_ScriptEngine))
m_ScriptEngines.Add(m_ScriptEngine); m_ScriptEngines.Add(m_ScriptEngine);