aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorCasperW2009-11-24 18:02:12 +0100
committerCasperW2009-11-24 18:02:12 +0100
commitd1147136946daf14724183b3191119be44ff8b16 (patch)
treefd5c056348acdd0ea82f4c797d15bcae3336ee28 /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentSwap the locking of m_EventQueue and m_Script to ease locks on script invento... (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 4e5fee1..4c8c94f 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1615,21 +1615,19 @@ namespace OpenSim.Region.Framework.Scenes
1615 SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); 1615 SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID);
1616 if (part != null) 1616 if (part != null)
1617 { 1617 {
1618 part.TaskInventory.LockItemsForRead(true);
1618 TaskInventoryDictionary taskIDict = part.TaskInventory; 1619 TaskInventoryDictionary taskIDict = part.TaskInventory;
1619 if (taskIDict != null) 1620 if (taskIDict != null)
1620 { 1621 {
1621 lock (taskIDict) 1622 foreach (UUID taskID in taskIDict.Keys)
1622 { 1623 {
1623 foreach (UUID taskID in taskIDict.Keys) 1624 UnRegisterControlEventsToScript(LocalId, taskID);
1624 { 1625 taskIDict[taskID].PermsMask &= ~(
1625 UnRegisterControlEventsToScript(LocalId, taskID); 1626 2048 | //PERMISSION_CONTROL_CAMERA
1626 taskIDict[taskID].PermsMask &= ~( 1627 4); // PERMISSION_TAKE_CONTROLS
1627 2048 | //PERMISSION_CONTROL_CAMERA
1628 4); // PERMISSION_TAKE_CONTROLS
1629 }
1630 } 1628 }
1631
1632 } 1629 }
1630 part.TaskInventory.LockItemsForRead(false);
1633 // Reset sit target. 1631 // Reset sit target.
1634 if (part.GetAvatarOnSitTarget() == UUID) 1632 if (part.GetAvatarOnSitTarget() == UUID)
1635 part.SetAvatarOnSitTarget(UUID.Zero); 1633 part.SetAvatarOnSitTarget(UUID.Zero);