aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 30c2223..b25be8e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -137,6 +137,8 @@ namespace OpenSim.Region.Framework.Scenes
137 protected IAssetService m_AssetService = null; 137 protected IAssetService m_AssetService = null;
138 protected IAuthorizationService m_AuthorizationService = null; 138 protected IAuthorizationService m_AuthorizationService = null;
139 139
140 private Object m_heartbeatLock = new Object();
141
140 public IAssetService AssetService 142 public IAssetService AssetService
141 { 143 {
142 get 144 get
@@ -940,6 +942,9 @@ namespace OpenSim.Region.Framework.Scenes
940 /// <param name="e"></param> 942 /// <param name="e"></param>
941 private void Heartbeat(object sender) 943 private void Heartbeat(object sender)
942 { 944 {
945 if (!Monitor.TryEnter(m_heartbeatLock))
946 return;
947
943 try 948 try
944 { 949 {
945 Update(); 950 Update();
@@ -950,6 +955,11 @@ namespace OpenSim.Region.Framework.Scenes
950 catch (ThreadAbortException) 955 catch (ThreadAbortException)
951 { 956 {
952 } 957 }
958 finally
959 {
960 Monitor.Pulse(m_heartbeatLock);
961 Monitor.Exit(m_heartbeatLock);
962 }
953 } 963 }
954 964
955 /// <summary> 965 /// <summary>
@@ -960,6 +970,12 @@ namespace OpenSim.Region.Framework.Scenes
960 int maintc = 0; 970 int maintc = 0;
961 while (!shuttingdown) 971 while (!shuttingdown)
962 { 972 {
973//#if DEBUG
974// int w = 0, io = 0;
975// ThreadPool.GetAvailableThreads(out w, out io);
976// if ((w < 10) || (io < 10))
977// m_log.DebugFormat("[WARNING]: ThreadPool reaching exhaustion. workers = {0}; io = {1}", w, io);
978//#endif
963 maintc = Environment.TickCount; 979 maintc = Environment.TickCount;
964 980
965 TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate; 981 TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate;