aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs24
1 files changed, 14 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 9e32ea5..362ab17 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -59,18 +59,22 @@ namespace OpenSim.Framework.Communications.Caches
59 /// <param name="userID"></param> 59 /// <param name="userID"></param>
60 public void AddNewUser(LLUUID userID) 60 public void AddNewUser(LLUUID userID)
61 { 61 {
62 if (!this.UserProfiles.ContainsKey(userID)) 62 // Potential fix - Multithreading issue.
63 lock (UserProfiles)
63 { 64 {
64 CachedUserInfo userInfo = new CachedUserInfo(this.m_parent); 65 if (!this.UserProfiles.ContainsKey(userID))
65 userInfo.UserProfile = this.RequestUserProfileForUser(userID);
66 if (userInfo.UserProfile != null)
67 { 66 {
68 this.RequestInventoryForUser(userID, userInfo); 67 CachedUserInfo userInfo = new CachedUserInfo(this.m_parent);
69 this.UserProfiles.Add(userID, userInfo); 68 userInfo.UserProfile = this.RequestUserProfileForUser(userID);
70 } 69 if (userInfo.UserProfile != null)
71 else 70 {
72 { 71 this.RequestInventoryForUser(userID, userInfo);
73 System.Console.WriteLine("CACHE", "User profile for user not found"); 72 this.UserProfiles.Add(userID, userInfo);
73 }
74 else
75 {
76 System.Console.WriteLine("CACHE", "User profile for user not found");
77 }
74 } 78 }
75 } 79 }
76 } 80 }