using System;
using System.Threading;
public class LockStatement
{
static EventWaitHandle _waitHandle = new AutoResetEvent (false);
public static void Main()
new Thread (Waiter).Start();
Thread.Sleep (1000); // Pause for a second...
_waitHandle.Set(); // Wake up the Waiter.
}
static void Waiter()
Console.WriteLine ("Waiting...");
_waitHandle.WaitOne(); // Wait for notification
Console.WriteLine ("Notified");