Professional Documents
Culture Documents
using System.Threading;
class MyThreadProgram
{
static void Main(string[] args)
{
Console.WriteLine("-Before starting thread- \n");
ThreadA.Start();
ThreadB.Start();
ThreadA.Join();
ThreadB.Join();
}
}
class MyThreadClass {
public static void Thread1()
{
for (int a = 0; a <= 5; a++)
{
Thread thread = Thread.CurrentThread;
Console.WriteLine("Name of Thread: " + thread.Name + " = " + a);
Thread.Sleep(1500);
}
}
}