diff options
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.cs | 16 |
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); |