opensim

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ HEAD  →  ?path2? @ 1
/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -49,8 +49,9 @@
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
private static Thread cmdHandlerThread;
private static int cmdHandlerThreadCycleSleepms;
private static readonly System.Timers.Timer cmdEventTimer = new System.Timers.Timer();
private static readonly AutoResetEvent cmdHandlerResetEvent = new AutoResetEvent(false);
 
/// <summary>
/// Lock for reading/writing static components of AsyncCommandManager.
@@ -170,31 +171,28 @@
if (!m_SensorRepeat.ContainsKey(m_ScriptEngine))
m_SensorRepeat[m_ScriptEngine] = new SensorRepeat(this);
if (!m_XmlRequest.ContainsKey(m_ScriptEngine))
m_XmlRequest[m_ScriptEngine] = new XmlRequest(this);
 
if (cmdEventTimer.Enabled.Equals(true)) return;
// Start the timer
cmdEventTimer.Elapsed += (sender, args) =>
{
try
{
DoOneCmdHandlerPass();
}
catch (Exception e)
{
m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
}
};
cmdEventTimer.Interval = cmdHandlerThreadCycleSleepms;
cmdEventTimer.Enabled = true;
m_XmlRequest[m_ScriptEngine] = new XmlRequest(this);
 
StartThread();
}
}
 
private static void StartThread()
{
if (cmdHandlerThread == null)
{
// Start the thread that will be doing the work
cmdHandlerThread
= Watchdog.StartThread(
CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true);
}
}
 
private void ReadConfig()
{
// cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100);
// TODO: Make this sane again
cmdHandlerThreadCycleSleepms = 50;
cmdHandlerThreadCycleSleepms = 100;
}
 
~AsyncCommandManager()
@@ -225,10 +223,10 @@
{
try
{
Thread.Sleep(cmdHandlerThreadCycleSleepms);
//Thread.Sleep(cmdHandlerThreadCycleSleepms);
 
DoOneCmdHandlerPass();
 
cmdHandlerResetEvent.WaitOne(-1, false);
Watchdog.UpdateThread();
}
catch (Exception e)
@@ -263,6 +261,7 @@
m_Dataserver[s].ExpireRequests();
}
}
cmdHandlerResetEvent.Set();
}
 
/// <summary>
@@ -442,4 +441,4 @@
}
}
}
}
}
/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -105,7 +105,7 @@
protected AsyncCommandManager AsyncCommands = null;
protected float m_ScriptDelayFactor = 1.0f;
protected float m_ScriptDistanceFactor = 1.0f;
protected float m_MinTimerInterval = 0.05f;
protected float m_MinTimerInterval = 0.01f;
protected float m_recoilScaleFactor = 0.0f;
 
protected DateTime m_timer = DateTime.Now;
@@ -165,7 +165,7 @@
m_ScriptDistanceFactor =
m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
m_MinTimerInterval =
m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.05f);
m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.01f);
m_automaticLinkPermission =
m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false);
m_notecardLineReadCharsMax =