aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorMelanie2009-10-27 11:32:11 +0000
committerMelanie2009-10-27 11:32:11 +0000
commit31a848e97bd984ab0a85feca397ce419f6ae839a (patch)
tree4743f5eb7c12b3723ed4b986d19714d1b3a0a3ea /OpenSim/Region/Application
parentCommented out instrumentation in ODEPrim.cs (diff)
parentFinally hunted down the Parallel deadlock. Packets were being handled asynchr... (diff)
downloadopensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.zip
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.gz
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.bz2
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs22
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs10
2 files changed, 24 insertions, 8 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index c04b8c2..b448182 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -67,7 +67,7 @@ namespace OpenSim
67 67
68 IConfig startupConfig = m_config.Source.Configs["Startup"]; 68 IConfig startupConfig = m_config.Source.Configs["Startup"];
69 69
70 Util.SetMaxThreads(startupConfig.GetInt("MaxPoolThreads", 15)); 70 int stpMaxThreads = 15;
71 71
72 if (startupConfig != null) 72 if (startupConfig != null)
73 { 73 {
@@ -100,8 +100,13 @@ namespace OpenSim
100 FireAndForgetMethod asyncCallMethod; 100 FireAndForgetMethod asyncCallMethod;
101 if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod)) 101 if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
102 Util.FireAndForgetMethod = asyncCallMethod; 102 Util.FireAndForgetMethod = asyncCallMethod;
103
104 stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15);
103 } 105 }
104 106
107 if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool)
108 Util.InitThreadPool(stpMaxThreads);
109
105 m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod); 110 m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod);
106 } 111 }
107 112
@@ -167,6 +172,9 @@ namespace OpenSim
167 m_scriptTimer.Elapsed += RunAutoTimerScript; 172 m_scriptTimer.Elapsed += RunAutoTimerScript;
168 } 173 }
169 174
175 // Hook up to the watchdog timer
176 Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
177
170 PrintFileToConsole("startuplogo.txt"); 178 PrintFileToConsole("startuplogo.txt");
171 179
172 // For now, start at the 'root' level by default 180 // For now, start at the 'root' level by default
@@ -379,6 +387,14 @@ namespace OpenSim
379 } 387 }
380 } 388 }
381 389
390 private void WatchdogTimeoutHandler(System.Threading.Thread thread, int lastTick)
391 {
392 int now = Environment.TickCount & Int32.MaxValue;
393
394 m_log.ErrorFormat("[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago",
395 thread.Name, thread.ThreadState, now - lastTick);
396 }
397
382 #region Console Commands 398 #region Console Commands
383 399
384 /// <summary> 400 /// <summary>
@@ -954,12 +970,12 @@ namespace OpenSim
954 m_sceneManager.ForEachScene( 970 m_sceneManager.ForEachScene(
955 delegate(Scene scene) 971 delegate(Scene scene)
956 { 972 {
957 scene.ClientManager.ForEachSync( 973 scene.ForEachClient(
958 delegate(IClientAPI client) 974 delegate(IClientAPI client)
959 { 975 {
960 connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n", 976 connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n",
961 scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode); 977 scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode);
962 } 978 }, false
963 ); 979 );
964 } 980 }
965 ); 981 );
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 3df3a1c..cc18f1a 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -162,11 +162,11 @@ namespace OpenSim
162 162
163 protected virtual void LoadPlugins() 163 protected virtual void LoadPlugins()
164 { 164 {
165 PluginLoader<IApplicationPlugin> loader = 165 using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this)))
166 new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this)); 166 {
167 167 loader.Load("/OpenSim/Startup");
168 loader.Load("/OpenSim/Startup"); 168 m_plugins = loader.Plugins;
169 m_plugins = loader.Plugins; 169 }
170 } 170 }
171 171
172 protected override List<string> GetHelpTopics() 172 protected override List<string> GetHelpTopics()