From 2a9796e2aa17aeb8143dc7f30a076b0d03da2d12 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 28 Oct 2008 15:01:43 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2482 * Stop 'show threads' throwing an exception if a thread is dead --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index f5e5c18..499b2f8 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -141,9 +141,23 @@ namespace OpenSim.Framework.Servers sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine); foreach (Thread t in threads) { - sb.Append( - "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive - + ", Pri: " + t.Priority + ", State: " + t.ThreadState + Environment.NewLine); + if (t.IsAlive) + { + sb.Append( + "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive + + ", Pri: " + t.Priority + ", State: " + t.ThreadState + Environment.NewLine); + } + else + { + try + { + sb.Append("ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", DEAD" + Environment.NewLine); + } + catch (Exception e) + { + sb.Append("THREAD ERROR" + Environment.NewLine); + } + } } } -- cgit v1.1