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.

afrisby
MW 2007-12-01 16:40:26 +00:00
parent 495cf040be
commit fff468dcfe
1 changed files with 7 additions and 4 deletions

View File

@ -49,11 +49,14 @@ namespace OpenSim.Framework.Communications.Cache
// Methods // Methods
public AgentAssetTransactions AddUser(LLUUID userID) public AgentAssetTransactions AddUser(LLUUID userID)
{ {
if (!AgentTransactions.ContainsKey(userID)) lock (AgentTransactions)
{ {
AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); if (!AgentTransactions.ContainsKey(userID))
AgentTransactions.Add(userID, transactions); {
return transactions; AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile);
AgentTransactions.Add(userID, transactions);
return transactions;
}
} }
return null; return null;
} }