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

@@ -78,8 +78,6 @@ namespace OpenSim.Grid.UserServer.Modules
private OpenSim.Framework.BlockingQueue<PresenceNotification> m_NotifyQueue =
new OpenSim.Framework.BlockingQueue<PresenceNotification>();
Thread m_NotifyThread;
private IGridServiceCore m_core;
public event AgentLocationDelegate OnAgentLocation;
@@ -96,8 +94,8 @@ namespace OpenSim.Grid.UserServer.Modules
{
m_core = core;
m_core.RegisterInterface<MessageServersConnector>(this);
m_NotifyThread = new Thread(new ThreadStart(NotifyQueueRunner));
m_NotifyThread.Start();
Watchdog.StartThread(NotifyQueueRunner, "NotifyQueueRunner", ThreadPriority.Normal, true);
}
public void PostInitialise()
@@ -427,6 +425,8 @@ namespace OpenSim.Grid.UserServer.Modules
{
TellMessageServersAboutUserLogoffInternal(presence.agentID);
}
Watchdog.UpdateThread();
}
}