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/OptionalModules/Scripting/Minimodule/SOPObject.cs | |
parent | minor: remove mono compiler warning (diff) | |
download | opensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.zip opensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.gz opensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.bz2 opensim-SC_OLD-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/OptionalModules/Scripting/Minimodule/SOPObject.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 96cccb7..34171b0 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -185,14 +185,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
185 | get | 185 | get |
186 | { | 186 | { |
187 | SceneObjectPart my = GetSOP(); | 187 | SceneObjectPart my = GetSOP(); |
188 | int total = my.ParentGroup.Children.Count; | 188 | IObject[] rets = null; |
189 | 189 | ||
190 | IObject[] rets = new IObject[total]; | 190 | lock (my.ParentGroup.Children) |
191 | |||
192 | int i = 0; | ||
193 | foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children) | ||
194 | { | 191 | { |
195 | rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security); | 192 | int total = my.ParentGroup.Children.Count; |
193 | |||
194 | rets = new IObject[total]; | ||
195 | |||
196 | int i = 0; | ||
197 | foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children) | ||
198 | { | ||
199 | rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security); | ||
200 | } | ||
196 | } | 201 | } |
197 | 202 | ||
198 | return rets; | 203 | return rets; |