diff options
author | Justin Clark-Casey (justincc) | 2010-07-17 01:18:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-17 01:18:43 +0100 |
commit | 95d9c773d94573026907d112a7ce82cf362bdd61 (patch) | |
tree | f981f1fd43f73407241c1a438face372e4d58870 | |
parent | extend exception catching for DoCreateChildAgentCall() from just WebException... (diff) | |
download | opensim-SC_OLD-95d9c773d94573026907d112a7ce82cf362bdd61.zip opensim-SC_OLD-95d9c773d94573026907d112a7ce82cf362bdd61.tar.gz opensim-SC_OLD-95d9c773d94573026907d112a7ce82cf362bdd61.tar.bz2 opensim-SC_OLD-95d9c773d94573026907d112a7ce82cf362bdd61.tar.xz |
Stop occasional permanently high 100% utilization when the server is started with many scripts
See http://opensimulator.org/mantis/view.php?id=4799 for more details
This is the equivalent patch that was applied to master 3.5 weeks ago, seemingly without bad consequences
Thanks Snoopy!
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d175695..256e3b0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -31,6 +31,7 @@ using System.IO; | |||
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Collections; | 32 | using System.Collections; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Threading; | ||
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using log4net; | 36 | using log4net; |
36 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
@@ -201,6 +202,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
201 | if ((int)InventoryType.LSL == item.InvType) | 202 | if ((int)InventoryType.LSL == item.InvType) |
202 | { | 203 | { |
203 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); | 204 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); |
205 | Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug | ||
204 | } | 206 | } |
205 | } | 207 | } |
206 | } | 208 | } |
@@ -258,7 +260,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
258 | // m_log.InfoFormat( | 260 | // m_log.InfoFormat( |
259 | // "[PRIM INVENTORY]: " + | 261 | // "[PRIM INVENTORY]: " + |
260 | // "Starting script {0}, {1} in prim {2}, {3}", | 262 | // "Starting script {0}, {1} in prim {2}, {3}", |
261 | // item.Name, item.ItemID, Name, UUID); | 263 | // item.Name, item.ItemID, m_part.Name, m_part.UUID); |
262 | 264 | ||
263 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 265 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) |
264 | return; | 266 | return; |
@@ -296,20 +298,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
296 | } | 298 | } |
297 | else | 299 | else |
298 | { | 300 | { |
299 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
300 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
301 | |||
302 | lock (m_items) | 301 | lock (m_items) |
303 | { | 302 | { |
303 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
304 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
305 | |||
304 | m_items[item.ItemID].PermsMask = 0; | 306 | m_items[item.ItemID].PermsMask = 0; |
305 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 307 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
308 | |||
309 | string script = Utils.BytesToString(asset.Data); | ||
310 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
311 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
312 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
313 | m_part.ScheduleFullUpdate(); | ||
306 | } | 314 | } |
307 | |||
308 | string script = Utils.BytesToString(asset.Data); | ||
309 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
310 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
311 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
312 | m_part.ScheduleFullUpdate(); | ||
313 | } | 315 | } |
314 | } | 316 | } |
315 | ); | 317 | ); |