aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorAdam Frisby2007-10-21 22:53:54 +0000
committerAdam Frisby2007-10-21 22:53:54 +0000
commit4dc8e7e0f8f0165fc242802864f39d9aab2f72d3 (patch)
tree4c6c27219eed1c2a8265a4a0c3db8be4d1ce46c7 /OpenSim/Framework
parent* Disabled TCP Remoting Channel Security for InterRegion communication, as it... (diff)
downloadopensim-SC_OLD-4dc8e7e0f8f0165fc242802864f39d9aab2f72d3.zip
opensim-SC_OLD-4dc8e7e0f8f0165fc242802864f39d9aab2f72d3.tar.gz
opensim-SC_OLD-4dc8e7e0f8f0165fc242802864f39d9aab2f72d3.tar.bz2
opensim-SC_OLD-4dc8e7e0f8f0165fc242802864f39d9aab2f72d3.tar.xz
* Added a lock to the user profile cache to prevent simultaneous duplicate additions to the database. (Attempting to fix bug reported by nebadon)
Diffstat (limited to 'OpenSim/Framework')
-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 }