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; }