* Stop 'show threads' throwing an exception if a thread is dead0.6.0-stable
parent
d8a6971a35
commit
2a9796e2aa
|
@ -140,11 +140,25 @@ namespace OpenSim.Framework.Servers
|
||||||
{
|
{
|
||||||
sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine);
|
sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine);
|
||||||
foreach (Thread t in threads)
|
foreach (Thread t in threads)
|
||||||
|
{
|
||||||
|
if (t.IsAlive)
|
||||||
{
|
{
|
||||||
sb.Append(
|
sb.Append(
|
||||||
"ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive
|
"ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive
|
||||||
+ ", Pri: " + t.Priority + ", State: " + t.ThreadState + Environment.NewLine);
|
+ ", 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
|
|
Loading…
Reference in New Issue