Add locking on m_primSyncInfoLock in InitPropertiesBySync and InitPropertiesSyncInfoFromOSDMap.

dsg
Huaiyu (Kitty) Liu 2011-05-03 13:54:59 -07:00
parent f8bf6c2cc4
commit eeb09f33e3
1 changed files with 20 additions and 14 deletions

View File

@ -5190,11 +5190,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
else else
initPrimProperties = FullSetPrimProperties; initPrimProperties = FullSetPrimProperties;
foreach (SceneObjectPartSyncProperties property in initPrimProperties) lock (m_primSyncInfoLock)
{ {
Object initValue = GetSOPPropertyValue(part, property); foreach (SceneObjectPartSyncProperties property in initPrimProperties)
PropertySyncInfo syncInfo = new PropertySyncInfo(property, initValue, initUpdateTimestamp, syncID); {
m_propertiesSyncInfo.Add(property, syncInfo); Object initValue = GetSOPPropertyValue(part, property);
PropertySyncInfo syncInfo = new PropertySyncInfo(property, initValue, initUpdateTimestamp, syncID);
m_propertiesSyncInfo.Add(property, syncInfo);
}
} }
} }
@ -5205,18 +5208,21 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
/// <param name="primSyncInfoData"></param> /// <param name="primSyncInfoData"></param>
private void InitPropertiesSyncInfoFromOSDMap(OSDMap primSyncInfoData) private void InitPropertiesSyncInfoFromOSDMap(OSDMap primSyncInfoData)
{ {
m_propertiesSyncInfo.Clear(); lock (m_primSyncInfoLock)
foreach (SceneObjectPartSyncProperties property in FullSetPrimProperties)
{ {
if (primSyncInfoData.ContainsKey(property.ToString())) m_propertiesSyncInfo.Clear();
foreach (SceneObjectPartSyncProperties property in FullSetPrimProperties)
{ {
PropertySyncInfo propertySyncInfo = new PropertySyncInfo(property, (OSDMap)primSyncInfoData[property.ToString()]); if (primSyncInfoData.ContainsKey(property.ToString()))
m_propertiesSyncInfo.Add(property, propertySyncInfo); {
} PropertySyncInfo propertySyncInfo = new PropertySyncInfo(property, (OSDMap)primSyncInfoData[property.ToString()]);
else m_propertiesSyncInfo.Add(property, propertySyncInfo);
{ }
//For Phantom prims, they don't have PhysActor properties. So this branch could happen. else
//DebugLog.WarnFormat("InitPropertiesSyncInfoFromOSDMap: Property {0} not included in the given OSDMap", property); {
//For Phantom prims, they don't have PhysActor properties. So this branch could happen.
//DebugLog.WarnFormat("InitPropertiesSyncInfoFromOSDMap: Property {0} not included in the given OSDMap", property);
}
} }
} }
} }