aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver
diff options
context:
space:
mode:
authorCasperW2009-11-24 18:02:12 +0100
committerCasperW2009-11-24 18:02:12 +0100
commitd1147136946daf14724183b3191119be44ff8b16 (patch)
treefd5c056348acdd0ea82f4c797d15bcae3336ee28 /OpenSim/Region/CoreModules/World/Archiver
parentSwap the locking of m_EventQueue and m_Script to ease locks on script invento... (diff)
downloadopensim-SC-d1147136946daf14724183b3191119be44ff8b16.zip
opensim-SC-d1147136946daf14724183b3191119be44ff8b16.tar.gz
opensim-SC-d1147136946daf14724183b3191119be44ff8b16.tar.bz2
opensim-SC-d1147136946daf14724183b3191119be44ff8b16.tar.xz
Drop all locking of part.TaskInventory in favour of a ReaderWriterLockSlim lock handler. This gives us:
- Faster prim inventory actions. Multiple threads can read at once. - Fixes the known prim inventory thread locks - In the event of a thread lock occurring, it will usually self heal after sixty seconds with an error message in the console
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 70a225e..f204faf 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -246,21 +246,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver
246 // Fix ownership/creator of inventory items 246 // Fix ownership/creator of inventory items
247 // Not doing so results in inventory items 247 // Not doing so results in inventory items
248 // being no copy/no mod for everyone 248 // being no copy/no mod for everyone
249 lock (part.TaskInventory) 249 part.TaskInventory.LockItemsForRead(true);
250 TaskInventoryDictionary inv = part.TaskInventory;
251 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
250 { 252 {
251 TaskInventoryDictionary inv = part.TaskInventory; 253 if (!ResolveUserUuid(kvp.Value.OwnerID))
252 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
253 { 254 {
254 if (!ResolveUserUuid(kvp.Value.OwnerID)) 255 kvp.Value.OwnerID = masterAvatarId;
255 { 256 }
256 kvp.Value.OwnerID = masterAvatarId; 257 if (!ResolveUserUuid(kvp.Value.CreatorID))
257 } 258 {
258 if (!ResolveUserUuid(kvp.Value.CreatorID)) 259 kvp.Value.CreatorID = masterAvatarId;
259 {
260 kvp.Value.CreatorID = masterAvatarId;
261 }
262 } 260 }
263 } 261 }
262 part.TaskInventory.LockItemsForRead(false);
264 } 263 }
265 264
266 if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) 265 if (m_scene.AddRestoredSceneObject(sceneObject, true, false))