diff options
author | CasperW | 2009-11-24 18:02:12 +0100 |
---|---|---|
committer | CasperW | 2009-11-24 18:02:12 +0100 |
commit | d1147136946daf14724183b3191119be44ff8b16 (patch) | |
tree | fd5c056348acdd0ea82f4c797d15bcae3336ee28 /OpenSim/Region/CoreModules | |
parent | Swap the locking of m_EventQueue and m_Script to ease locks on script invento... (diff) | |
download | opensim-SC_OLD-d1147136946daf14724183b3191119be44ff8b16.zip opensim-SC_OLD-d1147136946daf14724183b3191119be44ff8b16.tar.gz opensim-SC_OLD-d1147136946daf14724183b3191119be44ff8b16.tar.bz2 opensim-SC_OLD-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')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 21 |
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)) |