diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index bb5d51fa59..c395178740 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -45,6 +45,24 @@ namespace OpenSim.Services.Connectors LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + private Dictionary m_endpointSerializer = new Dictionary(); + private object EndPointLock(IAssetService connector) + { + lock (m_endpointSerializer) + { + object eplock = null; + + if (! m_endpointSerializer.TryGetValue(connector, out eplock)) + { + eplock = new object(); + m_endpointSerializer.Add(connector, eplock); + // m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint); + } + + return eplock; + } + } + private Dictionary m_connectors = new Dictionary(); public HGAssetServiceConnector(IConfigSource source) @@ -197,7 +215,8 @@ namespace OpenSim.Services.Connectors IAssetService connector = GetConnector(url); // Restore the assetID to a simple UUID asset.ID = assetID; - return connector.Store(asset); + lock (EndPointLock(connector)) + return connector.Store(asset); } return String.Empty;