aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2009-10-06 15:28:38 +0100
committerMelanie2009-10-06 15:28:38 +0100
commit2a060136bd89174a3071de9458c25af133c01b64 (patch)
tree3d45c11cd68627f13506594a89c7e99ae65fdc6c /OpenSim/Region/Framework/Scenes
parentRemove the using() constructs from the new style database modules; they caused (diff)
downloadopensim-SC_OLD-2a060136bd89174a3071de9458c25af133c01b64.zip
opensim-SC_OLD-2a060136bd89174a3071de9458c25af133c01b64.tar.gz
opensim-SC_OLD-2a060136bd89174a3071de9458c25af133c01b64.tar.bz2
opensim-SC_OLD-2a060136bd89174a3071de9458c25af133c01b64.tar.xz
Lock the heartbeat against multiple invocations. May prevent deadlocks and/or
runaway thread use
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d0dc021..c863c3b 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
@@ -942,6 +944,9 @@ namespace OpenSim.Region.Framework.Scenes
942 /// <param name="e"></param> 944 /// <param name="e"></param>
943 private void Heartbeat(object sender) 945 private void Heartbeat(object sender)
944 { 946 {
947 if (!Monitor.TryEnter(m_heartbeatLock))
948 return;
949
945 try 950 try
946 { 951 {
947 Update(); 952 Update();
@@ -952,6 +957,11 @@ namespace OpenSim.Region.Framework.Scenes
952 catch (ThreadAbortException) 957 catch (ThreadAbortException)
953 { 958 {
954 } 959 }
960 finally
961 {
962 Monitor.Pulse(m_heartbeatLock);
963 Monitor.Exit(m_heartbeatLock);
964 }
955 } 965 }
956 966
957 /// <summary> 967 /// <summary>