using System.Collections.Generic;
using System.Threading.Tasks;
private static AutoResetEvent AutoEvent = new AutoResetEvent(false);
public static void Main()
for(int i =0 ;i<=2 ;i++){
Thread t = new Thread(ThreadProc);
private static void ThreadProc(){
string name = Thread.CurrentThread.Name;
Console.WriteLine(name +"starts with wait");
Console.WriteLine(name+" released");