From fff468dcfe1dcca005a01f6370f1cd967f9c589a Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 1 Dec 2007 16:40:26 +0000 Subject: [PATCH] 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. --- .../Communications/Cache/AssetTransactionManager.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs index 55b255a513..cbf63ca715 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs @@ -49,11 +49,14 @@ namespace OpenSim.Framework.Communications.Cache // Methods public AgentAssetTransactions AddUser(LLUUID userID) { - if (!AgentTransactions.ContainsKey(userID)) + lock (AgentTransactions) { - AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); - AgentTransactions.Add(userID, transactions); - return transactions; + if (!AgentTransactions.ContainsKey(userID)) + { + AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); + AgentTransactions.Add(userID, transactions); + return transactions; + } } return null; }