aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-01-22 18:37:39 +0000
committerUbitUmarov2018-01-22 18:37:39 +0000
commitefc74803424a5e12ce780ecdd839d144123ae79e (patch)
tree50f1e052da7188d5fc4db40983a0a34716a7ce7f /OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
parentmissing files.. (diff)
downloadopensim-SC-efc74803424a5e12ce780ecdd839d144123ae79e.zip
opensim-SC-efc74803424a5e12ce780ecdd839d144123ae79e.tar.gz
opensim-SC-efc74803424a5e12ce780ecdd839d144123ae79e.tar.bz2
opensim-SC-efc74803424a5e12ce780ecdd839d144123ae79e.tar.xz
throtle datasnapshot gen
Diffstat (limited to 'OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs')
-rw-r--r--OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
index 0436f96..88fa1ae 100644
--- a/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
@@ -32,6 +32,7 @@ using System.IO;
32using System.Linq; 32using System.Linq;
33using System.Net; 33using System.Net;
34using System.Reflection; 34using System.Reflection;
35using System.Threading;
35using System.Text; 36using System.Text;
36using System.Xml; 37using System.Xml;
37using log4net; 38using log4net;
@@ -64,6 +65,7 @@ namespace OpenSim.Region.DataSnapshot
64 //Various internal objects 65 //Various internal objects
65 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 66 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
66 internal object m_syncInit = new object(); 67 internal object m_syncInit = new object();
68 private object m_serializeGen = new object();
67 69
68 //DataServices and networking 70 //DataServices and networking
69 private string m_dataServices = "noservices"; 71 private string m_dataServices = "noservices";
@@ -321,6 +323,11 @@ namespace OpenSim.Region.DataSnapshot
321 */ 323 */
322 public XmlDocument GetSnapshot(string regionName) 324 public XmlDocument GetSnapshot(string regionName)
323 { 325 {
326 if(!Monitor.TryEnter(m_serializeGen,30000))
327 {
328 return null;
329 }
330
324 CheckStale(); 331 CheckStale();
325 332
326 XmlDocument requestedSnap = new XmlDocument(); 333 XmlDocument requestedSnap = new XmlDocument();
@@ -360,9 +367,13 @@ namespace OpenSim.Region.DataSnapshot
360 m_log.Warn("[DATASNAPSHOT]: Caught unknown exception while trying to load snapshot: " + e.StackTrace); 367 m_log.Warn("[DATASNAPSHOT]: Caught unknown exception while trying to load snapshot: " + e.StackTrace);
361 requestedSnap = GetErrorMessage(regionName, e); 368 requestedSnap = GetErrorMessage(regionName, e);
362 } 369 }
363 370 finally
371 {
372 Monitor.Exit(m_serializeGen);
373 }
364 374
365 return requestedSnap; 375 return requestedSnap;
376
366 } 377 }
367 378
368 private XmlDocument GetErrorMessage(string regionName, Exception e) 379 private XmlDocument GetErrorMessage(string regionName, Exception e)