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.PacketHandlers.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.PacketHandlers.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index e25b1f1..9f1575d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -156,21 +156,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
156 | } | 156 | } |
157 | break; | 157 | break; |
158 | } | 158 | } |
159 | else | 159 | else |
160 | { | 160 | { |
161 | // We also need to check the children of this prim as they | 161 | // We also need to check the children of this prim as they |
162 | // can be selected as well and send property information | 162 | // can be selected as well and send property information |
163 | bool foundPrim = false; | 163 | bool foundPrim = false; |
164 | foreach (KeyValuePair<UUID, SceneObjectPart> child in ((SceneObjectGroup) ent).Children) | 164 | |
165 | { | 165 | SceneObjectGroup sog = ent as SceneObjectGroup; |
166 | if (child.Value.LocalId == primLocalID) | 166 | |
167 | { | 167 | lock (sog.Children) |
168 | child.Value.GetProperties(remoteClient); | 168 | { |
169 | foundPrim = true; | 169 | foreach (KeyValuePair<UUID, SceneObjectPart> child in (sog.Children)) |
170 | break; | 170 | { |
171 | } | 171 | if (child.Value.LocalId == primLocalID) |
172 | } | 172 | { |
173 | if (foundPrim) break; | 173 | child.Value.GetProperties(remoteClient); |
174 | foundPrim = true; | ||
175 | break; | ||
176 | } | ||
177 | } | ||
178 | } | ||
179 | |||
180 | if (foundPrim) | ||
181 | break; | ||
174 | } | 182 | } |
175 | } | 183 | } |
176 | } | 184 | } |