Join Thread to Wait for Each Other - CSharp Thread Asynchronous

CSharp examples for Thread Asynchronous:Thread

Description

Join Thread to Wait for Each Other

Demo Code

using System;/*from   ww w  .j a v  a 2  s  .c  om*/
using System.Threading;
public class JoinTest {
   public static void ThreadProc( ) {
      Console.WriteLine("Thread Active");
      Thread.Sleep( 30 * 1000 );
      Console.WriteLine("Thread Exiting");
   }
   public static void Main() {
      Thread T = new Thread( new ThreadStart( ThreadProc ) );
      T.Start( );
      T.Join( );
      Console.WriteLine("After Join");
   }
}

Result


Related Tutorials