Lock the heartbeat against multiple invocations. May prevent deadlocks and/or
runaway thread useprioritization
parent
8a7a947faa
commit
2a060136bd
|
@ -137,6 +137,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected IAssetService m_AssetService = null;
|
protected IAssetService m_AssetService = null;
|
||||||
protected IAuthorizationService m_AuthorizationService = null;
|
protected IAuthorizationService m_AuthorizationService = null;
|
||||||
|
|
||||||
|
private Object m_heartbeatLock = new Object();
|
||||||
|
|
||||||
public IAssetService AssetService
|
public IAssetService AssetService
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -942,6 +944,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void Heartbeat(object sender)
|
private void Heartbeat(object sender)
|
||||||
{
|
{
|
||||||
|
if (!Monitor.TryEnter(m_heartbeatLock))
|
||||||
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
|
@ -952,6 +957,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
catch (ThreadAbortException)
|
catch (ThreadAbortException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Monitor.Pulse(m_heartbeatLock);
|
||||||
|
Monitor.Exit(m_heartbeatLock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue