After reading Timer.cs in the mono source, I'm not

convinced that timer.Enabled modification is thread safe.
I suspect the statsHeartBeat call to be one of our hot spots
because is tries to synchronize not with a lock, but by
disabling and enabling itself.  I've replaced that with a lock
in the hopes that this affects either the 100% bug, or the
invoke_void bugs.
0.6.0-stable
Sean Dague 2008-04-16 10:54:32 +00:00
parent ebb4ac6853
commit 1eb0fedd93
1 changed files with 117 additions and 115 deletions

View File

@ -138,8 +138,10 @@ namespace OpenSim.Region.Environment.Scenes
private void statsHeartBeat(object sender, EventArgs e)
{
m_report.Enabled = false;
// Know what's not thread safe in Mono... modifying timers.
// System.Console.WriteLine("Firing Stats Heart Beat");
lock (m_report)
{
// Packet is already initialized and ready for data insert
@ -256,7 +258,7 @@ namespace OpenSim.Region.Environment.Scenes
handlerSendStatResult(statpack);
}
resetvalues();
m_report.Enabled = true;
}
}
private void resetvalues()