diff options
author | Justin Clarke Casey | 2009-02-20 14:04:29 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-20 14:04:29 +0000 |
commit | 01f70de2ea562f78991084be01a83295f8f2be0b (patch) | |
tree | ff43706bf83039ce9d9c6c5bfffe56f2df1d1c86 /OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |
parent | Revert previous commit (diff) | |
download | opensim-SC_OLD-01f70de2ea562f78991084be01a83295f8f2be0b.zip opensim-SC_OLD-01f70de2ea562f78991084be01a83295f8f2be0b.tar.gz opensim-SC_OLD-01f70de2ea562f78991084be01a83295f8f2be0b.tar.bz2 opensim-SC_OLD-01f70de2ea562f78991084be01a83295f8f2be0b.tar.xz |
* 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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 19 |
1 files changed, 11 insertions, 8 deletions
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 | |||
202 | // Fix ownership/creator of inventory items | 202 | // Fix ownership/creator of inventory items |
203 | // Not doing so results in inventory items | 203 | // Not doing so results in inventory items |
204 | // being no copy/no mod for everyone | 204 | // being no copy/no mod for everyone |
205 | TaskInventoryDictionary inv = part.TaskInventory; | 205 | lock (part.TaskInventory) |
206 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) | ||
207 | { | 206 | { |
208 | if (!ResolveUserUuid(kvp.Value.OwnerID)) | 207 | TaskInventoryDictionary inv = part.TaskInventory; |
208 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) | ||
209 | { | 209 | { |
210 | kvp.Value.OwnerID = masterAvatarId; | 210 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
211 | } | 211 | { |
212 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 212 | kvp.Value.OwnerID = masterAvatarId; |
213 | { | 213 | } |
214 | kvp.Value.CreatorID = masterAvatarId; | 214 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
215 | { | ||
216 | kvp.Value.CreatorID = masterAvatarId; | ||
217 | } | ||
215 | } | 218 | } |
216 | } | 219 | } |
217 | } | 220 | } |