diff options
author | Justin Clark-Casey (justincc) | 2010-08-26 00:08:53 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-08-26 00:08:53 +0100 |
commit | 8031f8ec09df4f654c86a9c7bc498664f7b9d9dc (patch) | |
tree | d6a6da4d448b9bc11ff8d1078b9be089b9872151 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | minor: remove mono compiler warning (diff) | |
download | opensim-SC-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.zip opensim-SC-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.gz opensim-SC-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.bz2 opensim-SC-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.xz |
Improve consistency of locking for SOG.m_parts in order to avoid race conditions in linking and unlinking
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 9fef8f4..379128a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1974,7 +1974,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1974 | if (null == group) | 1974 | if (null == group) |
1975 | return null; | 1975 | return null; |
1976 | 1976 | ||
1977 | if (!Permissions.CanRezObject(group.Children.Count, item.OwnerID, pos)) | 1977 | if (!Permissions.CanRezObject(group.PrimCount, item.OwnerID, pos)) |
1978 | return null; | 1978 | return null; |
1979 | 1979 | ||
1980 | if (!Permissions.BypassPermissions()) | 1980 | if (!Permissions.BypassPermissions()) |
@@ -2051,8 +2051,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2051 | sog.SetGroup(groupID, remoteClient); | 2051 | sog.SetGroup(groupID, remoteClient); |
2052 | sog.ScheduleGroupForFullUpdate(); | 2052 | sog.ScheduleGroupForFullUpdate(); |
2053 | 2053 | ||
2054 | foreach (SceneObjectPart child in sog.Children.Values) | 2054 | lock (sog.Children) |
2055 | child.Inventory.ChangeInventoryOwner(ownerID); | 2055 | { |
2056 | foreach (SceneObjectPart child in sog.Children.Values) | ||
2057 | child.Inventory.ChangeInventoryOwner(ownerID); | ||
2058 | } | ||
2056 | } | 2059 | } |
2057 | else | 2060 | else |
2058 | { | 2061 | { |
@@ -2062,16 +2065,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2062 | if (sog.GroupID != groupID) | 2065 | if (sog.GroupID != groupID) |
2063 | continue; | 2066 | continue; |
2064 | 2067 | ||
2065 | foreach (SceneObjectPart child in sog.Children.Values) | 2068 | lock (sog.Children) |
2066 | { | 2069 | { |
2067 | child.LastOwnerID = child.OwnerID; | 2070 | foreach (SceneObjectPart child in sog.Children.Values) |
2068 | child.Inventory.ChangeInventoryOwner(groupID); | 2071 | { |
2072 | child.LastOwnerID = child.OwnerID; | ||
2073 | child.Inventory.ChangeInventoryOwner(groupID); | ||
2074 | } | ||
2069 | } | 2075 | } |
2070 | 2076 | ||
2071 | sog.SetOwnerId(groupID); | 2077 | sog.SetOwnerId(groupID); |
2072 | sog.ApplyNextOwnerPermissions(); | 2078 | sog.ApplyNextOwnerPermissions(); |
2073 | } | 2079 | } |
2074 | |||
2075 | } | 2080 | } |
2076 | 2081 | ||
2077 | foreach (uint localID in localIDs) | 2082 | foreach (uint localID in localIDs) |