From 9c530d725f13da91caffdbce2759d58a456afff5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 15 Jun 2013 00:41:02 +0100 Subject: refactor: In UserProfileModule, change classifiedCache and classifiedInterest to m_classifiedCache and m_classifiedInterest This is the coding standard name style for private fields. --- .../Avatar/UserProfiles/UserProfileModule.cs | 42 ++++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 322addd..97bb781 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -60,8 +60,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles // The pair of Dictionaries are used to handle the switching of classified ads // by maintaining a cache of classified id to creator id mappings and an interest // count. The entries are removed when the interest count reaches 0. - Dictionary classifiedCache = new Dictionary(); - Dictionary classifiedInterest = new Dictionary(); + Dictionary m_classifiedCache = new Dictionary(); + Dictionary m_classifiedInterest = new Dictionary(); public Scene Scene { @@ -331,16 +331,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles classifieds[cid] = name; - if(!classifiedCache.ContainsKey(cid)) + lock(m_classifiedCache) { - lock(classifiedCache) - classifiedCache.Add(cid,creatorId); - lock(classifiedInterest) - classifiedInterest.Add(cid, 0); + if (!m_classifiedCache.ContainsKey(cid)) + { + m_classifiedCache.Add(cid,creatorId); + + lock(m_classifiedInterest) + m_classifiedInterest.Add(cid, 0); + } } - lock(classifiedInterest) - classifiedInterest[cid] ++; + lock(m_classifiedInterest) + m_classifiedInterest[cid]++; } remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds); @@ -352,19 +355,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles UserClassifiedAdd ad = new UserClassifiedAdd(); ad.ClassifiedId = queryClassifiedID; - if(classifiedCache.ContainsKey(queryClassifiedID)) + lock (classifie + if (m_classifiedCache.ContainsKey(queryClassifiedID)) { - target = classifiedCache[queryClassifiedID]; + target = m_classifiedCache[queryClassifiedID]; - lock(classifiedInterest) - classifiedInterest[queryClassifiedID] --; + lock(m_classifiedInterest) + m_classifiedInterest[queryClassifiedID] --; - if(classifiedInterest[queryClassifiedID] == 0) + if(m_classifiedInterest[queryClassifiedID] == 0) { - lock(classifiedInterest) - classifiedInterest.Remove(queryClassifiedID); - lock(classifiedCache) - classifiedCache.Remove(queryClassifiedID); + lock(m_classifiedInterest) + m_classifiedInterest.Remove(queryClassifiedID); + lock(m_classifiedCache) + m_classifiedCache.Remove(queryClassifiedID); } } @@ -1339,4 +1343,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles } #endregion Web Util } -} +} \ No newline at end of file -- cgit v1.1