From 01f70de2ea562f78991084be01a83295f8f2be0b Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 20 Feb 2009 14:04:29 +0000 Subject: * Consistently lock part.TaskInventory as pointed out in http://opensimulator.org/mantis/view.php?id=3159 * Not locking causes enumeration exceptions as described in this matis * part.TaskInventory needs to be locked for every access as it's a dictionary * Extra locking will hopefully not cause any major issues - in places where the enumeration of the dictionary performs other lock or long running operations, the dictionary is cloned instead --- .../CoreModules/World/Archiver/ArchiveReadRequest.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Archiver') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index d7ab5fd..fe1c42b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -202,16 +202,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Fix ownership/creator of inventory items // Not doing so results in inventory items // being no copy/no mod for everyone - TaskInventoryDictionary inv = part.TaskInventory; - foreach (KeyValuePair kvp in inv) + lock (part.TaskInventory) { - if (!ResolveUserUuid(kvp.Value.OwnerID)) + TaskInventoryDictionary inv = part.TaskInventory; + foreach (KeyValuePair kvp in inv) { - kvp.Value.OwnerID = masterAvatarId; - } - if (!ResolveUserUuid(kvp.Value.CreatorID)) - { - kvp.Value.CreatorID = masterAvatarId; + if (!ResolveUserUuid(kvp.Value.OwnerID)) + { + kvp.Value.OwnerID = masterAvatarId; + } + if (!ResolveUserUuid(kvp.Value.CreatorID)) + { + kvp.Value.CreatorID = masterAvatarId; + } } } } -- cgit v1.1