From 3769739ca75bd28a126034a74848012164db31b6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 4 Jul 2012 21:19:16 +0100 Subject: In llRequestInventoryData() use GetInventoryItems() rather than cloning TaskInventory directory GetInventoryItems() returns a new list and so is equivalent, and creates this list under lock whereas Clone() is not thread-safe --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ff4b690..66d99a2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4084,9 +4084,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - TaskInventoryDictionary itemDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone(); - - foreach (TaskInventoryItem item in itemDictionary.Values) + foreach (TaskInventoryItem item in m_host.Inventory.GetInventoryItems()) { if (item.Type == 3 && item.Name == name) { @@ -4118,6 +4116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return tid.ToString(); } } + ScriptSleep(1000); return String.Empty; } -- cgit v1.1