摘要:
static void Main() { Thread t1 = new Thread(Thread1); Thread t2 = new Thread(Thread2); t1.Start(); Thread.Sleep(100); t2.Start(); } static void Thread1() { Semaphore sema = new Semaphore(2, 3, "my"); sema.WaitOne(); sema.WaitOne(); Console.WriteLine("Thread1 get the Semaphore : " 阅读全文