Здравствуйте, anton_yp, Вы писали:
using System;
using System.Threading;
public class ThreadHolder
{
public Thread Thread;
}
public class Test
{
static void Main()
{
ThreadHolder th = new ThreadHolder();
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc), th);
Thread.Sleep(100);
th.Thread.Abort();
Thread.Sleep(100);
}
static void ThreadProc(object state)
{
Console.WriteLine("Thread started");
((ThreadHolder)state).Thread = Thread.CurrentThread;
try
{
Thread.Sleep(Timeout.Infinite);
}
finally
{
Console.WriteLine("Thread ended");
}
}
}
... << RSDN@Home 1.1.2 beta 1 (Win32NT 5.1.2600.0) >>