diff options
author | Justin Clark-Casey (justincc) | 2013-06-05 22:26:42 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-06-05 22:26:42 +0100 |
commit | 47ffa12078eb5a51c723cbc32b0ee22b87a2e4f4 (patch) | |
tree | c9344a0a2594a0ddece48a4e1a00eec4eac82fab | |
parent | Avoid a deadlock where a script can attempt to take a ScriptInstance.m_Script... (diff) | |
parent | Remove a couple of orphaned lines (diff) | |
download | opensim-SC_OLD-47ffa12078eb5a51c723cbc32b0ee22b87a2e4f4.zip opensim-SC_OLD-47ffa12078eb5a51c723cbc32b0ee22b87a2e4f4.tar.gz opensim-SC_OLD-47ffa12078eb5a51c723cbc32b0ee22b87a2e4f4.tar.bz2 opensim-SC_OLD-47ffa12078eb5a51c723cbc32b0ee22b87a2e4f4.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 5b228ee..13f0167 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
62 | // count. The entries are removed when the interest count reaches 0. | 62 | // count. The entries are removed when the interest count reaches 0. |
63 | Dictionary<UUID,UUID> classifiedCache = new Dictionary<UUID, UUID>(); | 63 | Dictionary<UUID,UUID> classifiedCache = new Dictionary<UUID, UUID>(); |
64 | Dictionary<UUID,int> classifiedInterest = new Dictionary<UUID, int>(); | 64 | Dictionary<UUID,int> classifiedInterest = new Dictionary<UUID, int>(); |
65 | Object classifiedLock; | ||
65 | 66 | ||
66 | public Scene Scene | 67 | public Scene Scene |
67 | { | 68 | { |
@@ -326,14 +327,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
326 | string name = m["name"].AsString(); | 327 | string name = m["name"].AsString(); |
327 | 328 | ||
328 | classifieds[cid] = name; | 329 | classifieds[cid] = name; |
329 | 330 | ||
330 | if(!classifiedCache.ContainsKey(cid)) | 331 | if(!classifiedCache.ContainsKey(cid)) |
331 | { | 332 | { |
332 | classifiedCache.Add(cid,creatorId); | 333 | lock(classifiedCache) |
333 | classifiedInterest.Add(cid, 0); | 334 | classifiedCache.Add(cid,creatorId); |
335 | lock(classifiedInterest) | ||
336 | classifiedInterest.Add(cid, 0); | ||
334 | } | 337 | } |
335 | 338 | ||
336 | classifiedInterest[cid] ++; | 339 | lock(classifiedInterest) |
340 | classifiedInterest[cid] ++; | ||
337 | } | 341 | } |
338 | 342 | ||
339 | remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds); | 343 | remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds); |
@@ -346,22 +350,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
346 | ad.ClassifiedId = queryClassifiedID; | 350 | ad.ClassifiedId = queryClassifiedID; |
347 | 351 | ||
348 | if(classifiedCache.ContainsKey(queryClassifiedID)) | 352 | if(classifiedCache.ContainsKey(queryClassifiedID)) |
349 | { | 353 | { |
350 | target = classifiedCache[queryClassifiedID]; | 354 | target = classifiedCache[queryClassifiedID]; |
351 | 355 | ||
352 | if(classifiedInterest[queryClassifiedID] -- == 0) | 356 | lock(classifiedInterest) |
357 | classifiedInterest[queryClassifiedID] --; | ||
358 | |||
359 | if(classifiedInterest[queryClassifiedID] == 0) | ||
353 | { | 360 | { |
361 | lock(classifiedInterest) | ||
362 | classifiedInterest.Remove(queryClassifiedID); | ||
354 | lock(classifiedCache) | 363 | lock(classifiedCache) |
355 | { | ||
356 | lock(classifiedInterest) | ||
357 | { | ||
358 | classifiedInterest.Remove(queryClassifiedID); | ||
359 | } | ||
360 | classifiedCache.Remove(queryClassifiedID); | 364 | classifiedCache.Remove(queryClassifiedID); |
361 | } | ||
362 | } | 365 | } |
363 | } | 366 | } |
364 | |||
365 | 367 | ||
366 | string serverURI = string.Empty; | 368 | string serverURI = string.Empty; |
367 | bool foreign = GetUserProfileServerURI(target, out serverURI); | 369 | bool foreign = GetUserProfileServerURI(target, out serverURI); |