From f130e1a86f2e00abf4e77403858814219bffd3bb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 12 Nov 2011 00:24:45 +0000 Subject: [PATCH 1/2] Add threads to the watchdog thread list before we start them. Hopefully this wil make "WATCHDOG: Asked to update thread ## which is not being monitored" messages." go away. --- OpenSim/Framework/Watchdog.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs index 5ffa8909e6..3a40d0e137 100644 --- a/OpenSim/Framework/Watchdog.cs +++ b/OpenSim/Framework/Watchdog.cs @@ -122,6 +122,11 @@ namespace OpenSim.Framework public static Thread StartThread( ThreadStart start, string name, ThreadPriority priority, bool isBackground, int timeout) { + m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")"); + + lock (m_threads) + m_threads.Add(twi.Thread.ManagedThreadId, twi); + Thread thread = new Thread(start); thread.Name = name; thread.Priority = priority; @@ -130,11 +135,6 @@ namespace OpenSim.Framework ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout); - m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")"); - - lock (m_threads) - m_threads.Add(twi.Thread.ManagedThreadId, twi); - return thread; } From e61ea79c722f186a6f9335405604b4f809d7c3b2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 12 Nov 2011 00:27:43 +0000 Subject: [PATCH 2/2] doh - correct build break --- OpenSim/Framework/Watchdog.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs index 3a40d0e137..8e82f5ad29 100644 --- a/OpenSim/Framework/Watchdog.cs +++ b/OpenSim/Framework/Watchdog.cs @@ -122,19 +122,20 @@ namespace OpenSim.Framework public static Thread StartThread( ThreadStart start, string name, ThreadPriority priority, bool isBackground, int timeout) { + Thread thread = new Thread(start); + thread.Name = name; + thread.Priority = priority; + thread.IsBackground = isBackground; + + ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout); + m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")"); lock (m_threads) m_threads.Add(twi.Thread.ManagedThreadId, twi); - Thread thread = new Thread(start); - thread.Name = name; - thread.Priority = priority; - thread.IsBackground = isBackground; thread.Start(); - ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout); - return thread; }