Implemented a Watchdog class. Do not manually create Thread objects anymore, use Watchdog.StartThread(). While your thread is running call Watchdog.UpdateThread(). When it is shutting down call Watchdog.RemoveThread(). Most of the threads in OpenSim have been updated

This commit is contained in:
John Hurliman
2009-10-22 12:33:23 -07:00
parent 11013ad295
commit b2ed348aa2
17 changed files with 309 additions and 123 deletions

View File

@@ -33,6 +33,7 @@ using System.Reflection;
using System.Text;
using System.Threading;
using log4net;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
@@ -56,8 +57,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
m_listener.Start(50);
Thread thread = new Thread(ListenLoop);
thread.Start();
Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false);
m_baseScene = baseScene;
}
@@ -72,7 +72,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
while (m_running)
{
AcceptClient(m_listener.AcceptTcpClient());
Watchdog.UpdateThread();
}
Watchdog.RemoveThread();
}
private void AcceptClient(TcpClient client)