public static void Main0() { LockMe l = new LockMe(); WaitAndPulse e1 = new WaitAndPulse(l); WaitAndPulse2 e2 = new WaitAndPulse2(l); Thread t1 = new Thread(new ThreadStart(e1.CriticalSection)); t1.Start(); Thread t2 = new Thread(new ThreadStart(e2.CriticalSection)); t2.Start(); Console.ReadLine(); }
static void Main(string[] args) { LockMe l = new LockMe(); WaitPalse1 e1 = new WaitPalse1(l); WaitPalse2 e2 = new WaitPalse2(l); Thread nt1 = new Thread(new ThreadStart(e1.CriticalSection)); nt1.Start(); Thread nt2 = new Thread(new ThreadStart(e2.CriticalSection)); nt2.Start(); Console.ReadLine(); }
public WaitAndPulse2(LockMe l) { lM = l; }
public WaitPalse2(LockMe l) { _IM = l; }