aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2015-07-22 20:39:30 +0300
committerOren Hurvitz2015-07-22 20:39:30 +0300
commit43c8e2396e2d25036027638ca0e61606876f11c7 (patch)
tree19c9d894bcbb7851f75d5dda9dbb17b0a4bc29f6 /OpenSim
parentRobust config loader does not support config includes. Replace these addition... (diff)
downloadopensim-SC_OLD-43c8e2396e2d25036027638ca0e61606876f11c7.zip
opensim-SC_OLD-43c8e2396e2d25036027638ca0e61606876f11c7.tar.gz
opensim-SC_OLD-43c8e2396e2d25036027638ca0e61606876f11c7.tar.bz2
opensim-SC_OLD-43c8e2396e2d25036027638ca0e61606876f11c7.tar.xz
Added locking to HypergridLinker, to prevent problems if multiple linking requests for the same region are handled simultaneously
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 0fd059f..a774303 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -186,12 +186,12 @@ namespace OpenSim.Services.GridService
186 private static Random random = new Random(); 186 private static Random random = new Random();
187 187
188 // From the command line link-region (obsolete) and the map 188 // From the command line link-region (obsolete) and the map
189 public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason) 189 private GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason)
190 { 190 {
191 return TryLinkRegionToCoords(scopeID, mapName, xloc, yloc, UUID.Zero, out reason); 191 return TryLinkRegionToCoords(scopeID, mapName, xloc, yloc, UUID.Zero, out reason);
192 } 192 }
193 193
194 public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason) 194 private GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason)
195 { 195 {
196 reason = string.Empty; 196 reason = string.Empty;
197 GridRegion regInfo = null; 197 GridRegion regInfo = null;
@@ -274,13 +274,21 @@ namespace OpenSim.Services.GridService
274 274
275 return null; 275 return null;
276 } 276 }
277 277
278 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, UUID ownerID, out GridRegion regInfo, out string reason) 278 private bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, UUID ownerID, out GridRegion regInfo, out string reason)
279 { 279 {
280 return TryCreateLink(scopeID, xloc, yloc, remoteRegionName, externalPort, externalHostName, null, ownerID, out regInfo, out reason); 280 return TryCreateLink(scopeID, xloc, yloc, remoteRegionName, externalPort, externalHostName, null, ownerID, out regInfo, out reason);
281 } 281 }
282 282
283 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) 283 private bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
284 {
285 lock (this)
286 {
287 return TryCreateLinkImpl(scopeID, xloc, yloc, remoteRegionName, externalPort, externalHostName, serverURI, ownerID, out regInfo, out reason);
288 }
289 }
290
291 private bool TryCreateLinkImpl(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
284 { 292 {
285 m_log.InfoFormat("[HYPERGRID LINKER]: Link to {0} {1}, in <{2},{3}>", 293 m_log.InfoFormat("[HYPERGRID LINKER]: Link to {0} {1}, in <{2},{3}>",
286 ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), 294 ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),