Ejemplo n.º 1
0
 public static int Main(String[] args) {
 CO_TryFinally	T	= new CO_TryFinally();
 Thread			t1	= new Thread(new ThreadStart(T.run));
 Thread			t2	= new Thread(new ThreadStart(T.run2));
 Thread			t3	= new Thread(new ThreadStart(T.run3));
 t1.Start();
 t2.Start();
 t3.Start();
 Thread.Sleep(2000);
 Console.WriteLine("1: Abort( )");
 t1.Abort();
 t1.Join();
 Console.WriteLine("2: Abort( )");
 t2.Abort();
 t2.Join();
 Console.WriteLine("3: Abort( )");
 t3.Abort();
 t3.Join();
 return 0;
 }
Ejemplo n.º 2
0
    public static int Main(String[] args)
    {
        CO_TryFinally T  = new CO_TryFinally();
        Thread        t1 = new Thread(new ThreadStart(T.run));
        Thread        t2 = new Thread(new ThreadStart(T.run2));
        Thread        t3 = new Thread(new ThreadStart(T.run3));

        t1.Start();
        t2.Start();
        t3.Start();
        Thread.Sleep(2000);
        Console.WriteLine("1: Abort( )");
        t1.Abort();
        t1.Join();
        Console.WriteLine("2: Abort( )");
        t2.Abort();
        t2.Join();
        Console.WriteLine("3: Abort( )");
        t3.Abort();
        t3.Join();
        return(0);
    }