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/CoreModules/World/Archiver | |
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 '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index bc653ce..1623e6e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -243,36 +243,39 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
243 | // to the same scene (when this is possible). | 243 | // to the same scene (when this is possible). |
244 | sceneObject.ResetIDs(); | 244 | sceneObject.ResetIDs(); |
245 | 245 | ||
246 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 246 | lock (sceneObject.Children) |
247 | { | 247 | { |
248 | if (!ResolveUserUuid(part.CreatorID)) | 248 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
249 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
250 | |||
251 | if (!ResolveUserUuid(part.OwnerID)) | ||
252 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
253 | |||
254 | if (!ResolveUserUuid(part.LastOwnerID)) | ||
255 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
256 | |||
257 | // And zap any troublesome sit target information | ||
258 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); | ||
259 | part.SitTargetPosition = new Vector3(0, 0, 0); | ||
260 | |||
261 | // Fix ownership/creator of inventory items | ||
262 | // Not doing so results in inventory items | ||
263 | // being no copy/no mod for everyone | ||
264 | lock (part.TaskInventory) | ||
265 | { | 249 | { |
266 | TaskInventoryDictionary inv = part.TaskInventory; | 250 | if (!ResolveUserUuid(part.CreatorID)) |
267 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) | 251 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
252 | |||
253 | if (!ResolveUserUuid(part.OwnerID)) | ||
254 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
255 | |||
256 | if (!ResolveUserUuid(part.LastOwnerID)) | ||
257 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
258 | |||
259 | // And zap any troublesome sit target information | ||
260 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); | ||
261 | part.SitTargetPosition = new Vector3(0, 0, 0); | ||
262 | |||
263 | // Fix ownership/creator of inventory items | ||
264 | // Not doing so results in inventory items | ||
265 | // being no copy/no mod for everyone | ||
266 | lock (part.TaskInventory) | ||
268 | { | 267 | { |
269 | if (!ResolveUserUuid(kvp.Value.OwnerID)) | 268 | TaskInventoryDictionary inv = part.TaskInventory; |
270 | { | 269 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) |
271 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
272 | } | ||
273 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | ||
274 | { | 270 | { |
275 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 271 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
272 | { | ||
273 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
274 | } | ||
275 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | ||
276 | { | ||
277 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
278 | } | ||
276 | } | 279 | } |
277 | } | 280 | } |
278 | } | 281 | } |