Пример #1
0
 private static void DoSomeReading()
 {
     while (true)
     {
         _testReadWriteLock.AcquireReader();
         Console.WriteLine(Thread.CurrentThread.Name + ": Yeah! I'm reading!");
         Thread.Sleep(new Random().Next(1000, 1500));
         Console.WriteLine("\t" + Thread.CurrentThread.Name + ": Well, I'm done reading.");
         _testReadWriteLock.ReleaseReader();
     }
 }