aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMW2007-12-01 16:40:26 +0000
committerMW2007-12-01 16:40:26 +0000
commitfff468dcfe1dcca005a01f6370f1cd967f9c589a (patch)
tree2275f861c20b5a0c1a135760a6057728406eaa24 /OpenSim/Framework
parentAttempted fix for mantis issue# 66 (diff)
downloadopensim-SC_OLD-fff468dcfe1dcca005a01f6370f1cd967f9c589a.zip
opensim-SC_OLD-fff468dcfe1dcca005a01f6370f1cd967f9c589a.tar.gz
opensim-SC_OLD-fff468dcfe1dcca005a01f6370f1cd967f9c589a.tar.bz2
opensim-SC_OLD-fff468dcfe1dcca005a01f6370f1cd967f9c589a.tar.xz
Attempt to fix mantis issue # 65, seems like it is a race condition between two regions trying to add a user to the AssetTransactionManager at the same time. So have placed a lock around the Dictionary add.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
index 55b255a..cbf63ca 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
@@ -49,11 +49,14 @@ namespace OpenSim.Framework.Communications.Cache
49 // Methods 49 // Methods
50 public AgentAssetTransactions AddUser(LLUUID userID) 50 public AgentAssetTransactions AddUser(LLUUID userID)
51 { 51 {
52 if (!AgentTransactions.ContainsKey(userID)) 52 lock (AgentTransactions)
53 { 53 {
54 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); 54 if (!AgentTransactions.ContainsKey(userID))
55 AgentTransactions.Add(userID, transactions); 55 {
56 return transactions; 56 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile);
57 AgentTransactions.Add(userID, transactions);
58 return transactions;
59 }
57 } 60 }
58 return null; 61 return null;
59 } 62 }