aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
index bb5d51f..c395178 100644
--- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
@@ -45,6 +45,24 @@ namespace OpenSim.Services.Connectors
45 LogManager.GetLogger( 45 LogManager.GetLogger(
46 MethodBase.GetCurrentMethod().DeclaringType); 46 MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 private Dictionary<IAssetService, object> m_endpointSerializer = new Dictionary<IAssetService, object>();
49 private object EndPointLock(IAssetService connector)
50 {
51 lock (m_endpointSerializer)
52 {
53 object eplock = null;
54
55 if (! m_endpointSerializer.TryGetValue(connector, out eplock))
56 {
57 eplock = new object();
58 m_endpointSerializer.Add(connector, eplock);
59 // m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
60 }
61
62 return eplock;
63 }
64 }
65
48 private Dictionary<string, IAssetService> m_connectors = new Dictionary<string, IAssetService>(); 66 private Dictionary<string, IAssetService> m_connectors = new Dictionary<string, IAssetService>();
49 67
50 public HGAssetServiceConnector(IConfigSource source) 68 public HGAssetServiceConnector(IConfigSource source)
@@ -197,7 +215,8 @@ namespace OpenSim.Services.Connectors
197 IAssetService connector = GetConnector(url); 215 IAssetService connector = GetConnector(url);
198 // Restore the assetID to a simple UUID 216 // Restore the assetID to a simple UUID
199 asset.ID = assetID; 217 asset.ID = assetID;
200 return connector.Store(asset); 218 lock (EndPointLock(connector))
219 return connector.Store(asset);
201 } 220 }
202 221
203 return String.Empty; 222 return String.Empty;